[LightDM] session-cleanup-script on logout/reboot
tjoen
tjoen at dds.nl
Wed May 7 09:49:59 PDT 2014
On 07-05-14 11:59, Andre Esser wrote:
> On 2014-05-01 17:40, tjoen wrote:
>> On 01-05-14 13:14, Andre Esser wrote:
>>> tjoen wrote:
>>>> On 30-04-14 16:08, Andre Esser wrote:
>>>>> I've created a script to back up the user's home directory
>>>>> on logout by using the session-cleanup-script parameter in
>>>>> lightdm.conf.
>>>>>
>>>>> This is working fine if the user only logs out without
>>>>> restarting or shutting down the PC.
>>>>> If the user shuts down or reboots the PC from their Gnome
>>>>> session, the script is still called, but it appears the
>>>>> shutdown process continues before the script terminates.
>>>>> The script runs for about 5 seconds, then the PC powers
>>>>> off/reboots.
>>>>>
>>>>> Is this the expected behaviour?
>>>>>
>>>>> Ubuntu 14.04 (lightdm 1.10.0)
>>>> Which init is Ubuntu using? Upstart or systemd?
>>>> I think easiest way is to add a wait in a stop-script.
>>> Ubuntu 14.04 is still using Upstart. Any idea where that wait
>>> needs to go? The backup script waits for user input (using
>>> gdialog), so the wait has to come before the desktop session
>>> terminates.
>>>
>> You can try first to put a poststop script/exec in /etc/init/lightdm.conf
>> containing /bin/sleep 10
>> If that is ignored by Upstart then you need to edit the Upstart killall
>> configuration file
>> I don't remember the exact syntax, only the principles of Upstart
> The post-stop script in /etc/init/lightdm.conf worked in principle and
> stopped the PC from shutting down too soon. Unfortunately that didn't
> stop NFS shares from being unmounted, so my backup script still failed.
> Tried to delay the NFS umount in a similar manner, but that caused the
> PC to freeze on shutdown. Don't have any more time to look into this, so
> giving up.
>
>
Before unmounting there has to be a killall.conf, possible with another
name.
The solution would be to put something like "stop on starting killall"
in lightdm.conf
I don't remember the exact syntax.
The idea is to run lightdm-stop before killall is starting.
More information about the LightDM
mailing list