Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 25

Thread: "sddm" ignores "HaltCommand"

  1. #11
    Join Date
    Sep 2012
    Posts
    6,311

    Default Re: "sddm" ignores "HaltCommand"

    Quote Originally Posted by the_wumpus View Post
    Well, the idea is that if the machine is powered off (by the user selecting "shut down" from the desktop, or from the DM), some backup shall be performed before the real power-off.
    Why not simply create service that performs needed actions as ExecStop command during shutdown?

  2. #12
    Join Date
    Oct 2008
    Location
    Germany, Bremen
    Posts
    59

    Default Re: "sddm" ignores "HaltCommand"

    Quote Originally Posted by arvidjaar View Post
    Why not simply create service that performs needed actions as ExecStop command during shutdown?
    At which service to put the ExecStop ? I wanted the following things to be considered: a) Unneeded services (webserver, database server, all users, ...) should have stopped before the backup is started, b) do not change original files if possible to avoid problems if files are overwritten by update, c) do not change the original behavior of "systemctl shutdown". All this is pretty good accomplished by creating a set of own services. This works and is not the real problem.

    The only, remaining problem is that sddm unfortunately refuses to use customized halt (power-off) commands as proposed...

    Regards, the_wumpus

  3. #13
    Join Date
    Feb 2010
    Location
    Germany
    Posts
    3,955

    Question Re: "sddm" ignores "HaltCommand"

    Quote Originally Posted by the_wumpus View Post
    The only, remaining problem is that sddm unfortunately refuses to use customized halt (power-off) commands as proposed...
    Meaning that, the Simple Desktop Display Manager is maybe a little too simple and therefore, some code reading is needed …
    • I had a suspicion that, within the “[General] section” and specifically the “HaltCommand=” option, SDDM accepts only one parameter to the “systemctl” command but, your test showed that this is not the case – all “systemctl” parameters are ignored …
    • Even worse, the “HaltCommand=” option itself may well be being ignored by SDDM …
    • The /sbin/ commands “halt” and “reboot” are symbolic links to “/usr/bin/systemctl” – what happens if the “HaltCommand=” option simply calls the command “reboot” (without a path … )?

  4. #14
    Join Date
    Oct 2008
    Location
    Germany, Bremen
    Posts
    59

    Unhappy Re: "sddm" ignores "HaltCommand"

    Quote Originally Posted by dcurtisfra View Post
    Meaning that, the Simple Desktop Display Manager is maybe a little too simple and therefore, some code reading is needed …
    Well, simple in my opinion should never mean that features described in the documentation are just ignored without any note. But, being used to aerospace engineering, I might have been just too optimistic. So, what I got from this discussion, is that I did not oversee something concerning sddm configuration (I had also replaced "/bin" by "/usr/bin"), but that somehow sddm is maybe a bit "unfinished". Let's see if I find some time checking the code... sigh.

    Regards, the_wumpus

  5. #15
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    13,280
    Blog Entries
    2

    Default Re: "sddm" ignores "HaltCommand"

    Base only on a quick Google search on SDDM options and reading the SDDM ArchWiki,
    It seems that Display Managers support different options, they aren't nearly the same in what they do and how they can be customized.

    So,
    For instance although it might show up somewhere in the MAN pages and elsewhere (I didn't check), the commands you are trying to enable aren't mentioned so can be assumed are not supported.

    In any case, I'm not envisioning why you should need a custom Halt command (or alias for that matter... Is that an option for you?)
    I'm envisioning you can script anything you want to happen during a customized shutdown, giving the master script a unique name and then your User can invoke it instead of the normal shutdown.

    TSU
    Beginner Wiki Quickstart - https://en.opensuse.org/User:Tsu2/Quickstart_Wiki
    Solved a problem recently? Create a wiki page for future personal reference!
    Learn something new?
    Attended a computing event?
    Post and Share!

  6. #16
    Join Date
    Sep 2012
    Posts
    6,311

    Default Re: "sddm" ignores "HaltCommand"

    Quote Originally Posted by the_wumpus View Post
    At which service to put the ExecStop ?
    Your own service that you create.

  7. #17
    Join Date
    Feb 2010
    Location
    Germany
    Posts
    3,955

    Default Re: "sddm" ignores "HaltCommand"

    Quote Originally Posted by the_wumpus View Post
    Well, simple in my opinion should never mean that features described in the documentation are just ignored without any note.
    I suspect that, “simple” for the case of SDDM means “simplistic” – a little bit too much simplification …
    • Possibly a little bit too much Qt and not enough UML or SDL State Machines …

  8. #18
    Join Date
    Oct 2008
    Location
    Germany, Bremen
    Posts
    59

    Default Re: "sddm" ignores "HaltCommand"

    Quote Originally Posted by dcurtisfra View Post
    Possibly a little bit too much Qt and not enough UML or SDL State Machines …
    Yeap, it's full of QT stuff.
    Besides that, a first code review and additional internet research revealed that sddm supports different "power managers" via backends, and for some of them it simple redirects the shutdown command to that power manager, thereby happily ignoring any custom halt configuration. Of course it is not possible to configure which backend to use. IMHO this feature / behavior should have been documented ... need more time to investigate, maybe I have to configure the power manager and not sddm...

  9. #19
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    13,280
    Blog Entries
    2

    Default Re: "sddm" ignores "HaltCommand"

    I still do not understand your wish to create a custom poweroff command.
    To me, a "poweroff" is simple, and clearly defined... A particular action that is uncomplicated.

    Why do you insist in a complex poweroff?
    A typical modular approach to programming easily suggests that any modifications should be kept separate, and would be executed prior to a standard poweroff.

    Are you restricting yourself by method of invoking a shutdown/poweroff?
    Are working with some other kind of restriction that requires that the shutdown/poweroff command be invoked by the DM?

    TSU
    Beginner Wiki Quickstart - https://en.opensuse.org/User:Tsu2/Quickstart_Wiki
    Solved a problem recently? Create a wiki page for future personal reference!
    Learn something new?
    Attended a computing event?
    Post and Share!

  10. #20
    Join Date
    Oct 2008
    Location
    Germany, Bremen
    Posts
    59

    Default Re: "sddm" ignores "HaltCommand"

    Quote Originally Posted by tsu2 View Post
    I still do not understand your wish to create a custom poweroff command.
    To me, a "poweroff" is simple, and clearly defined... A particular action that is uncomplicated.
    Seems I was not able to explain it correctly, sorry. I am implementing some backup solution, which fulfills the following requirements:
    • The backup shall be performed if the computer is going to be powered off. Its not a server, it's a desktop which usually gets powered off at the end of the day or whenever the job is finished.
    • By doing the backup just before power off, after each user is logged out and major services (such as database server etc.) have stopped, I avoid the problem with files being modified during backup. Only the minimum required services are running during backup (network, sshd, local mounts).
    • I what it to be seamlessly integrated into the standard way the computer is operated, that means the user selects power down from the desktop or the display manager, and that's it. I don't want the user to have to call a special command before selecting power off; besides that in this case it would be difficult to stop non required services as the user of course is not logged in as root (ok, could use suid, but that's not the point here).
    • I, however, do not want the original systemd shutdown or power off services or any script to be altered, to avoid any problems by updates overwriting the altered files.
    • Finally, it would be nice not to have the original behavior of shutdown power off being altered, again to avoid possible conflicts.

    ... and after all, this was not really hard to implement. It is based on rsnapshot plus some custom systemd services, no altering of "original" services was required. And all to have it seamlessly integrated into the "standard way" is to change the command sddm performs if a shutdown is selected by the user - pretty easy and straight forward, well, at least it should have been like this...

    Hopefully I now explained it correctly. If not, it may be better to contact me via private message, as I have the feeling this is going off-topic meanwhile because the original request was just about why sddm ignores custom halt commands. Any that seems to be getting clear now as I realized that the shutdown command may be just forwarded to some external power manager instead calling the default or custom shutdown command.

    Regards, the_wumpus

Page 2 of 3 FirstFirst 123 LastLast

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •