Re: scheduling services first during shutdown/reboot

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



12.02.2025 16:35, Olaf Hering wrote:
What is the proper way to run a service as the very first unit when the
system goes down? I want to run it before systemd stops active sessions
with "Stopping Session N of User $user...".

It seems that "After=session-N.scope" does have the desired effect,
but I may have to list every possible value of N, to not miss anything.


mkdir -p /etc/systemd/system/session-.scope.d
printf "[Unit]\nBefore=your-very-first.service\n" > /etc/systemd/system/session-.scope.d/before.conf

There is nothing obvious mentioned in systemd.special.


Thanks,
Olaf




[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux