proper place for xrandr script to run before sddm?
Hi *, on my notebook I use a small script to handle the connected graphics ports via xrandr. This script has to be run before sddm-greeter gets started. For a long time now the script was started from [/usr]/etc/X11/xdm/Xsetup, because I couldn't find a better place for it. It is annoying, though, that Xsetup gets overwritten with every update of xdm. What's more annoying, is the fact, that no .rpmsave file is created during update, despite the fact I had modified the file. Is there a better/proper place for a script like that, where it can survive an update unchanged? Something like Xsetup.d/? TIA. Bye. Michael.
mh@mike.franken.de composed on 2021-03-30 20:21 (UTC+0200):
on my notebook I use a small script to handle the connected graphics ports via xrandr. This script has to be run before sddm-greeter gets started. For a long time now the script was started from [/usr]/etc/X11/xdm/Xsetup, because I couldn't find a better place for it. It is annoying, though, that Xsetup gets overwritten with every update of xdm. What's more annoying, is the fact, that no .rpmsave file is created during update, despite the fact I had modified the file.
Is there a better/proper place for a script like that, where it can survive an update unchanged? Something like Xsetup.d/?
I put my own xrandr script in /etc/X11/xinit/xinitrc.d/. Whether it affects SDDM I don't recall, as I use SDDM on at most maybe 6% of my installations, and those don't get much use. -- Evolution as taught in public schools, like religion, is based on faith, not on science. Team OS/2 ** Reg. Linux User #211409 ** a11y rocks! Felix Miata *** http://fm.no-ip.com/
On Dienstag, 30. März 2021 20:32:32 CEST Felix Miata wrote:
mh@mike.franken.de composed on 2021-03-30 20:21 (UTC+0200):
on my notebook I use a small script to handle the connected graphics ports via xrandr. This script has to be run before sddm-greeter gets started. For a long time now the script was started from [/usr]/etc/X11/xdm/Xsetup, because I couldn't find a better place for it. It is annoying, though, that Xsetup gets overwritten with every update of xdm. What's more annoying, is the fact, that no .rpmsave file is created during update, despite the fact I had modified the file.
Is there a better/proper place for a script like that, where it can survive an update unchanged? Something like Xsetup.d/?
I put my own xrandr script in /etc/X11/xinit/xinitrc.d/. Whether it affects SDDM I don't recall, as I use SDDM on at most maybe 6% of my installations, and those don't get much use.
Thx, but no - the script isn't executed at all from this place. And yes, it is executable. Bye. Michael.
On 30.03.2021 21:21, mh@mike.franken.de wrote:
Hi *,
on my notebook I use a small script to handle the connected graphics ports via xrandr. This script has to be run before sddm-greeter gets started. For a long time now the script was started from [/usr]/etc/X11/xdm/Xsetup,
/usr/etc is unlikely to be "for a long time". Also telling your distribution and version would be helpful.
because I couldn't find a better place for it. It is annoying, though, that Xsetup gets overwritten with every update of xdm. What's more annoying, is the fact, that no .rpmsave file is created during update, despite the fact I had modified the file.
If file is not changed between two package versions it should be left as is. rpmsave/rpmnew are created if file changed in package *and* was modified on disk. As /etc/X11/xdm/Xsetup was not changed in 5 years, this would explain why no rpmsave is created (but then it also should not be replaced). And files in /usr/etc are not intended to be editable, so these files are unconditionally overwritten on update - this is absolutely correct and expected behavior.
Is there a better/proper place for a script like that, where it can survive an update unchanged? Something like Xsetup.d/?
You can define any script you like in your display manager configuration. For SDDM this is probably DisplayCommand, but I am not familiar enough with it.
On Dienstag, 30. März 2021 21:26:47 CEST Andrei Borzenkov wrote:
On 30.03.2021 21:21, mh@mike.franken.de wrote:
Hi *,
on my notebook I use a small script to handle the connected graphics ports via xrandr. This script has to be run before sddm-greeter gets started. For a long time now the script was started from [/usr]/etc/X11/xdm/Xsetup, /usr/etc is unlikely to be "for a long time". Also telling your distribution and version would be helpful.
This happens on Leap 15.2 and on Tumbleweed.
because I couldn't find a better place for it. It is annoying, though, that Xsetup gets overwritten with every update of xdm. What's more annoying, is the fact, that no .rpmsave file is created during update, despite the fact I had modified the file.
If file is not changed between two package versions it should be left as is. rpmsave/rpmnew are created if file changed in package *and* was modified on disk. As /etc/X11/xdm/Xsetup was not changed in 5 years, this would explain why no rpmsave is created (but then it also should not be replaced). And files in /usr/etc are not intended to be editable, so these files are unconditionally overwritten on update - this is absolutely correct and expected behavior.
Ok, so an rpm does not respect local modifications and is set to overwrite a file without telling anyone about that fact? This is not what I observed, but you are more experienced regarding this I presume.
Is there a better/proper place for a script like that, where it can survive an update unchanged? Something like Xsetup.d/?
You can define any script you like in your display manager configuration. For SDDM this is probably DisplayCommand, but I am not familiar enough with it.
Same problem here. /etc/sddm.conf gets overwritten without any notice 8-< This is where I came from. Bye. Michael.
On 30/03/2021 22.07, mh@mike.franken.de wrote:
On Dienstag, 30. März 2021 21:26:47 CEST Andrei Borzenkov wrote:
On 30.03.2021 21:21, mh@mike.franken.de wrote:
Hi *,
on my notebook I use a small script to handle the connected graphics ports via xrandr. This script has to be run before sddm-greeter gets started. For a long time now the script was started from [/usr]/etc/X11/xdm/Xsetup, /usr/etc is unlikely to be "for a long time". Also telling your distribution and version would be helpful.
This happens on Leap 15.2 and on Tumbleweed.
because I couldn't find a better place for it. It is annoying, though, that Xsetup gets overwritten with every update of xdm. What's more annoying, is the fact, that no .rpmsave file is created during update, despite the fact I had modified the file.
If file is not changed between two package versions it should be left as is. rpmsave/rpmnew are created if file changed in package *and* was modified on disk. As /etc/X11/xdm/Xsetup was not changed in 5 years, this would explain why no rpmsave is created (but then it also should not be replaced). And files in /usr/etc are not intended to be editable, so these files are unconditionally overwritten on update - this is absolutely correct and expected behavior.
Ok, so an rpm does not respect local modifications and is set to overwrite a file without telling anyone about that fact?
No, that is not what he said. -- Cheers / Saludos, Carlos E. R. (from 15.2 x86_64 at Telcontar)
On Dienstag, 30. März 2021 22:26:53 CEST Carlos E. R. wrote:
On 30/03/2021 22.07, mh@mike.franken.de wrote:
On Dienstag, 30. März 2021 21:26:47 CEST Andrei Borzenkov wrote:
On 30.03.2021 21:21, mh@mike.franken.de wrote: [...] If file is not changed between two package versions it should be left as is. rpmsave/rpmnew are created if file changed in package *and* was modified on disk. As /etc/X11/xdm/Xsetup was not changed in 5 years, this would explain why no rpmsave is created (but then it also should not be replaced). And files in /usr/etc are not intended to be editable, so these files are unconditionally overwritten on update - this is absolutely correct and expected behavior.
Ok, so an rpm does not respect local modifications and is set to overwrite a file without telling anyone about that fact?
No, that is not what he said.
He wrote: "rpmsave/rpmnew are created if file changed in package *and* was modified on disk" So I understand: If the file is modified on disk only, it will be overwritten by the unmodified file from the package and no rpmsave/rpmnew file is created. Did I get that wrong? Bye. Michael.`
On 31/03/2021 11.42, mh@mike.franken.de wrote:
On Dienstag, 30. März 2021 22:26:53 CEST Carlos E. R. wrote:
On 30/03/2021 22.07, mh@mike.franken.de wrote:
On Dienstag, 30. März 2021 21:26:47 CEST Andrei Borzenkov wrote:
On 30.03.2021 21:21, mh@mike.franken.de wrote: [...] If file is not changed between two package versions it should be left as is. rpmsave/rpmnew are created if file changed in package *and* was modified on disk. As /etc/X11/xdm/Xsetup was not changed in 5 years, this would explain why no rpmsave is created (but then it also should not be replaced). And files in /usr/etc are not intended to be editable, so these files are unconditionally overwritten on update - this is absolutely correct and expected behavior.
Ok, so an rpm does not respect local modifications and is set to overwrite a file without telling anyone about that fact?
No, that is not what he said.
He wrote:
"rpmsave/rpmnew are created if file changed in package *and* was modified on disk"
He also said "files in /usr/etc are not intended to be editable, so these files are unconditionally overwritten on update - this is absolutely correct and expected behavior." I understand you edited "/usr/etc/X11/xdm/Xsetup", so that file will never get the rpmsave/rpmnew mechanism. If I edit an script from an rpm package, I have no expectations that it will be respected by updates. And that's what you did.
So I understand: If the file is modified on disk only, it will be overwritten by the unmodified file from the package and no rpmsave/rpmnew file is created. Did I get that wrong?
Yes, you got it wrong. He said it should not be overwritten by the package if the file in the package doesn't change. -- Cheers / Saludos, Carlos E. R. (from 15.2 x86_64 at Telcontar)
On Mittwoch, 31. März 2021 11:58:18 CEST Carlos E. R. wrote:
On 31/03/2021 11.42, mh@mike.franken.de wrote:
On Dienstag, 30. März 2021 22:26:53 CEST Carlos E. R. wrote:
On 30/03/2021 22.07, mh@mike.franken.de wrote:
On Dienstag, 30. März 2021 21:26:47 CEST Andrei Borzenkov wrote:
On 30.03.2021 21:21, mh@mike.franken.de wrote: [...] He wrote:
"rpmsave/rpmnew are created if file changed in package *and* was modified on disk"
He also said "files in /usr/etc are not intended to be editable, so these files are unconditionally overwritten on update - this is absolutely correct and expected behavior."
I understand you edited "/usr/etc/X11/xdm/Xsetup", so that file will never get the rpmsave/rpmnew mechanism.
I edited /etc/X11/xdm/Xsetup in the first place - until the new behaviour using /usr/etc was introduced. Afterwards I edited /usr/etc/X11/xdm/Xsetup. I am not sure, though, if /etc/X11/xdm/Xsetup has been overwritten in the past, too.
If I edit an script from an rpm package, I have no expectations that it will be respected by updates. And that's what you did.
So I understand: If the file is modified on disk only, it will be overwritten by the unmodified file from the package and no rpmsave/rpmnew file is created. Did I get that wrong?
Yes, you got it wrong. He said it should not be overwritten by the package if the file in the package doesn't change.
Ok, the file in /usr/etc/X11/xdm has been overwritten, but I don't know if it has been changed. Thx for clarificaton. Bye. Michael.
On 31/03/2021 13.24, mh@mike.franken.de wrote:
On Mittwoch, 31. März 2021 11:58:18 CEST Carlos E. R. wrote:
On 31/03/2021 11.42, mh@mike.franken.de wrote:
...
Thx for clarificaton.
To me, the important thing is that it is a script. It is code, not configuration file. Thus, it is not part of the rpmsave/rpmnew mechanism. -- Cheers / Saludos, Carlos E. R. (from 15.2 x86_64 at Telcontar)
On 31.03.2021 19:02, Carlos E. R. wrote:
To me, the important thing is that it is a script. It is code, not configuration file. Thus, it is not part of the rpmsave/rpmnew mechanism.
rpm does not know file type "script" and it cannot read your mind. rpm knows files marked as configuration files. The /etc/X11/xdm/Xsetup is marked as %config and so if file is changed in new package version *and* file was modified on disk, file should have been saved as .rpmsave and replaced by file in new package version.
On 31/03/2021 19.41, Andrei Borzenkov wrote:
On 31.03.2021 19:02, Carlos E. R. wrote:
To me, the important thing is that it is a script. It is code, not configuration file. Thus, it is not part of the rpmsave/rpmnew mechanism.
rpm does not know file type "script" and it cannot read your mind. rpm knows files marked as configuration files. The /etc/X11/xdm/Xsetup is marked as %config and so if file is changed in new package version *and* file was modified on disk, file should have been saved as .rpmsave and replaced by file in new package version.
Well, apparently that did not happen. -- Cheers / Saludos, Carlos E. R. (from 15.2 x86_64 at Telcontar)
On 30.03.2021 23:07, mh@mike.franken.de wrote:
Is there a better/proper place for a script like that, where it can survive an update unchanged? Something like Xsetup.d/?
You can define any script you like in your display manager configuration. For SDDM this is probably DisplayCommand, but I am not familiar enough with it.
Same problem here. /etc/sddm.conf gets overwritten without any notice 8-<
Even assuming this is true there is also /etc/sddm.conf.d.
This is where I came from.
Bye. Michael.
On Mittwoch, 31. März 2021 07:02:50 CEST Andrei Borzenkov wrote:
On 30.03.2021 23:07, mh@mike.franken.de wrote:
Is there a better/proper place for a script like that, where it can survive an update unchanged? Something like Xsetup.d/?
You can define any script you like in your display manager configuration. For SDDM this is probably DisplayCommand, but I am not familiar enough with it.
Same problem here. /etc/sddm.conf gets overwritten without any notice 8-<
Even assuming this is true there is also /etc/sddm.conf.d.
Ah, ok, I'll try to put it there. Thx. Bye. Michael.
participants (4)
-
Andrei Borzenkov
-
Carlos E. R.
-
Felix Miata
-
mh@mike.franken.de