Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 295051 Details for
Bug 431107
halt script does not work with upstart
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
check runlevel in halt/reboot, set --force accordingly
upstart-runlevel.patch (text/plain), 1.15 KB, created by
Bill Nottingham
on 2008-02-15 23:03:27 UTC
(
hide
)
Description:
check runlevel in halt/reboot, set --force accordingly
Filename:
MIME Type:
Creator:
Bill Nottingham
Created:
2008-02-15 23:03:27 UTC
Size:
1.15 KB
patch
obsolete
>diff -up upstart-0.3.9/compat/sysv/reboot.c.foo upstart-0.3.9/compat/sysv/reboot.c >--- upstart-0.3.9/compat/sysv/reboot.c.foo 2008-02-15 16:52:30.000000000 -0500 >+++ upstart-0.3.9/compat/sysv/reboot.c 2008-02-15 17:47:37.000000000 -0500 >@@ -36,6 +36,7 @@ > #include <stdlib.h> > #include <string.h> > #include <unistd.h> >+#include <utmp.h> > > #include <linux/if.h> > #include <linux/hdreg.h> >@@ -158,12 +159,31 @@ static NihOption options[] = { > NIH_OPTION_LAST > }; > >+static char get_runlevel(void) >+{ >+ struct utmp utmp, *lvl; >+ char *rl, runlevel = 0; >+ >+ if ((rl = getenv("RUNLEVEL")) != NULL) >+ return *rl; >+ >+ memset(&utmp, 0, sizeof(utmp)); >+ utmp.ut_type = RUN_LVL; >+ setutent(); >+ lvl = getutid(&utmp); >+ if (lvl) >+ runlevel = lvl->ut_pid % 256; >+ endutent(); >+ return runlevel; >+} >+ > > int > main (int argc, > char *argv[]) > { > char **args; >+ char level; > int mode; > > nih_main_init (argv[0]); >@@ -211,6 +231,12 @@ main (int argc, > > if (exit_only) > exit (0); >+ >+ level = get_runlevel(); >+ if (level) { >+ if (level == '0' || level == '6') >+ force = TRUE; >+ } > > /* Normally we just exec shutdown, which notifies everyone and > * signals init.
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 431107
: 295051