]> git.ipfire.org Git - ipfire-3.x.git/commitdiff
Changed handling of shutdown / reboot events.
authorStefan Schantl <Stevee@ipfire.org>
Sun, 23 Aug 2009 19:20:05 +0000 (21:20 +0200)
committerStefan Schantl <Stevee@ipfire.org>
Sun, 23 Aug 2009 19:20:05 +0000 (21:20 +0200)
Now the shutdown job will be started on shutdown and reboot events. The
UPSTSRT_EVENTS variable is used to determite the request and perform the action.

src/initscripts/core/shutdown.conf

index a0a3bbfa5d071a97d55db8a89cf98fe2d94d5224..21d69d3340b721c55850329f240aea601f7cf6fa 100644 (file)
@@ -1,11 +1,19 @@
-description            "Shutdown the system"
+description            "Shutdown or reboot the system"
 author                 "IPFire Team"
 
+start on shutdown
+start on reboot
+
 console output
 
-task
-exec initctl emit --no-wait shutdown
+script
+       # Some stuff for the shutdown / reboot process
 
-post-stop script
-       poweroff -f
+       # The UPSTART_EVENTS variable contains the event that has called the
+       # script and is used to perform the requested action.
+       if [ "$UPSTART_EVENTS" -eq shutdown ]; then
+               poweroff -f
+       else
+               reboot -f
+       fi
 end script