Hi, 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) Thanks, Andre -- Andre Esser, IT Manager, Geneity Ltd 80 Hammersmith Road, London, W14 8UD Registered in England, No. 05676580
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.
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. Many thanks, Andre