Robin H. Johnson
e6fc30da61
Clean up all trailing whitespace in src/.
2011-01-17 08:28:43 +00:00
Robin H. Johnson
49339525a9
Bug #351712 : Implement --applet selection mode for SELinux wrappers.
...
In addition to detecting what multicall applet we want via argv[0],
provide an explicit override mode with a --applet initial argument.
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
2011-01-17 07:37:43 +00:00
Robin H. Johnson
b00ad439a6
Add new option -F to rc-depend tool, so that we can debug user deptree files easily.
2011-01-17 06:53:50 +00:00
Robin H. Johnson
0e90ae266a
Factor out new function rc_deptree_load_file to aid in debugging deptree files from users. Loads from a given filename instead of the hardcoded RC_DEPTREE_CACHE define.
2011-01-17 06:32:46 +00:00
Eray Aslan
66abbefd6c
bug 351160: make openrc exit codes LSB compliant
...
* status on a stopped service now has a return code of 3 (was 1)
* starting an already started service now has a return code of 0 (was 1)
* stopping an already stopped service now has a return code of 0 (was 1)
2011-01-12 19:46:11 -06:00
Robin H. Johnson
647df8cfe7
Make sure old rc_sys code never runs if the rc_sys variable exists.
...
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
2011-01-05 22:33:03 -08:00
Robin H. Johnson
3d4d1ab14b
Remove broken automatic LXC subsystem detection.
...
Any system using cgroups was being detected as an LXC system. This was
triggering on OpenVZ under RHEL6 as well as the "automated per tty task
groups" as discussed on the LKML.
All LXC users should now switch to the new rc_sys variable introduced in
the previous patch.
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
2011-01-05 22:09:34 -08:00
Robin H. Johnson
09f990a7c8
Implement explicit selection of subsystem types.
...
- Fixes bugs #347583 , #349389 , both of which were triggered by cgroups
being detected as the LXC subsystem type.
- Makes it much easier to select "prefix" type.
- "rc -S" will now print a warning if you have not configured rc_sys in
/etc/rc.conf
- All other semantics of rc_sys are unchanged in this patch.
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
2011-01-05 22:09:34 -08:00
Thomas Pfaff
062223a5df
Avoid race condition in runscript (bug #319865 )
...
Under normal conditions, runscript creates one child and waits for its
termination, which is signaled by a pipe write from the SIGCHLD
sighandler.
When running killprocs however more than one SIGHCLD signal is generated, at
least on all of my amd64 boxes running on real hardware and in vmware.
When the first SIGCHLD occurs svc_exec leaves the loop and closes the pipe.
Subsequent SIGCHLDs during the close can lead to a race condition and create an
EBADF error in the pipe write (pipe is closed but the file handle is still !=
-1).
We avoid this by blocking SIGHCHLD during the pipe close.
2010-12-03 14:01:28 -06:00
Mike Frysinger
3036b44798
restore init.d pause option
2010-04-09 02:19:40 -04:00
Mike Frysinger
acc0edb040
restore old e* func output
...
Gentoo has always used the sytle:
* moo ... [ ok ]
Latest openrc now does:
* moo... [ok]
Realistically, 4 spaces out of 80 on reduced terminals doesn't make any
sort of realistic difference and it's been just fine for the last 10
years, so keep the default behavior.
2010-04-09 02:19:40 -04:00
Roy Marples
4d86d34635
Fix -s and -S.
2010-03-26 22:10:03 +00:00
Roy Marples
7271449a0c
Fix two leaks.
2010-03-17 20:37:47 +00:00
Mike Frysinger
ecf9ef49a7
random spelling fixes
...
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2010-01-08 22:02:51 +00:00
Roy Marples
dc3ccd8101
start-stop-daemon can now set process IO scheduling.
2009-12-14 08:47:48 +00:00
Roy Marples
509e34d425
Only allow one service to be provided by default.
...
Fixes Gentoo #293139 .
2009-11-14 08:37:05 +00:00
Roy Marples
0de1d18d41
Fix logic
2009-11-13 22:29:01 +00:00
Roy Marples
80d4ce3a11
Add a --warn option to just warn when reference file does not exist.
...
Fixes Gentoo #291894 .
2009-11-13 21:31:09 +00:00
Roy Marples
95ee39ab1c
Add support for Linux Containers, fixes #202 .
...
Patch by bug reporter.
2009-11-04 19:21:24 +00:00
Roy Marples
ac6808a73e
Regenerate version.h if necessary
2009-10-16 08:13:34 +01:00
William Hubbs
c96a015742
fix wait time for gentoo bug 288495
...
The wait time was in seconds. This patch converts it to milliseconds.
2009-10-15 20:25:01 +01:00
Roy Marples
a8f6a9b654
Add new utility and init script swclock that sets the system time based on
...
the mtime of a file. It saves the shutdown time to this file also.
This is handy for systems without a working RTC chip.
Based on an idea by Michael A. Smith <michael@smith-li.com>.
Fixes Gentoo #272073 .
2009-10-13 08:03:45 +01:00
Roy Marples
07f9be7b1c
Add pkg-config support, fixes #187 .
2009-10-08 00:20:43 +01:00
Roy Marples
42ca23b878
Don't quote opts
2009-09-21 19:05:47 +01:00
Roy Marples
3dc712e222
Allow init scripts to show their dependencies easier
2009-09-04 16:00:08 +01:00
Roy Marples
44585fea46
Add -P to start-stop-daemon to display a . for each second elapsed.
...
Fixes #197 .
2009-09-04 15:41:08 +01:00
Roy Marples
6e485bde39
Really fix --signal 0
2009-09-04 13:32:59 +01:00
Roy Marples
2ea1df634e
Fix signed error.
2009-09-04 13:24:26 +01:00
Roy Marples
7012630302
Allow any valid numeric signal and not just what we define.
2009-09-01 13:57:45 +01:00
Roy Marples
7fbb6ad427
Don't provide ourself, fixes #190
2009-07-20 19:42:15 +01:00
Roy Marples
b4104957b1
We should use -feature instead of nofeature.
...
This matches the ifconfig and Gentoo USE flag syntax and is hopefully
easier to read.
Fixes #178 .
2009-07-01 00:07:32 +01:00
Roy Marples
6abeec7430
Use rc_getline instead of assuming a fixed kernel cmdline length.
...
This is now requires as COMMAND_LINE_SIZE isn't exposed by kernel
headers anymore.
Fixes #177 .
2009-06-21 12:20:53 +01:00
Roy Marples
c3e9a7ec14
Warn about going inactive correctly.
2009-06-01 20:10:42 +01:00
Roy Marples
c0fd1b49e4
Move non compiled libraries from /lib/rc to /libexec/rc
...
OpenRC version is now stored as plaintext in /libexec/rc/version
Plugins (cursplash, splashutils) will have to be re-compiled to pickup
the new directories. State data needs to be moved from /lib/rc/init.d
to /libexec/rc/init.d as well.
2009-05-23 20:38:12 +01:00
Roy Marples
5294abe617
If already started or stopped, abort.
2009-05-17 12:29:46 +01:00
Roy Marples
b2eb9f8a83
Unset PAM environment variables if not set
2009-05-07 12:20:59 +01:00
Roy Marples
7c81f74b60
Fix compile on NetBSD
2009-05-05 16:39:59 +01:00
Roy Marples
43063ae7c2
Fix compile on NetBSD and FreeBSD
2009-05-05 10:24:21 +01:00
Roy Marples
6615eb4b68
Add runlevel stacking, #88
...
This implementation has the limitation that you cannot have a stacked
runlevel and service of the same name in a runlevel.
2009-05-02 12:26:45 +01:00
Roy Marples
e040bd77e9
Ignore test results
2009-05-02 12:18:34 +01:00
Roy Marples
658a220638
Add (c) to Copyright
2009-05-01 15:11:40 +01:00
Roy Marples
fb051bf81a
Add -i, --ifexists so that we can do this
...
rc-sercice -i foo -- restart
instead of this
rc-service -e foo && rc-service foo -- restart
2009-05-01 08:38:57 +01:00
Roy Marples
caf29a6480
Fix git versioning
2009-05-01 00:15:20 +01:00
Roy Marples
f689187966
Add -Z, --dry-run option to show which services we would start/stop
...
without actually doing so.
Fixes #151 .
2009-04-30 23:42:01 +01:00
Roy Marples
3d0e5175d8
Avoid more gcc warning about not checking return values ...
2009-04-30 19:56:43 +01:00
Roy Marples
21e45e895c
Brand with git version instead of svn
2009-04-30 19:16:31 +01:00
Juan RP
a1e40e9beb
Fix parens
2009-04-30 16:45:18 +01:00
Roy Marples
b70501ef45
Go back to git
2009-04-30 15:05:39 +01:00
Roy Marples
e0f0fc8046
Don't start services when their need dependency is broken
2009-04-28 08:29:02 +00:00
Roy Marples
94b3057571
Add the noshutdown keyword to special case the shutdown.
2009-04-27 12:04:33 +00:00
Roy Marples
338c93733d
Fix the nstop keyword.
2009-04-27 09:06:30 +00:00
Roy Marples
eaa32c75c9
Add the nostop keyword so that we don't stop the network init script by default.
2009-04-26 21:16:05 +00:00
Roy Marples
77c8f8abbb
Use /bin/bash or user shell in /etc/passwd if none set before /bin/sh.
2009-04-26 17:57:06 +00:00
Roy Marples
0feddbd815
Use kill for the pid check as it's fast.
2009-04-25 20:44:13 +00:00
Roy Marples
c07b384d82
Don't drop to sulogin by default, but make this configurable.
2009-04-24 11:49:55 +00:00
Roy Marples
bd211d534b
We should match the full variable name.
2009-04-24 11:45:48 +00:00
Roy Marples
b0ac71fe2a
Add missing show levels switch.
2009-04-24 10:23:49 +00:00
Roy Marples
9966a902ab
rc-status -c now lists services that have crashed.
...
It returns 0 if there are crashed services, otherwise 1.
This it easy to restart crashed services automatically.
More for #120 .
2009-04-24 10:17:53 +00:00
Roy Marples
5276b13926
Cast to int
2009-04-24 08:32:44 +00:00
Roy Marples
e7b35a8f15
Allow rc to start (optionally stop) crashed services, #120
2009-04-24 07:03:08 +00:00
Roy Marples
e643a7fdd5
Describe interval units
2009-04-24 06:37:29 +00:00
Roy Marples
ade85d4bd8
Improve style for KNF
2009-04-23 21:31:22 +00:00
Roy Marples
6953474655
Style
2009-04-23 20:53:24 +00:00
Roy Marples
7086df5664
Don't include hotplugged services in manual.
2009-04-23 20:27:40 +00:00
Roy Marples
7dc9c39503
Improve the service timeout code and reduce the timeout to 60 seconds.
...
Don't process any dependencies when changing runlevels and called
outside of RC otherwise we can deadlock.
2009-04-23 20:20:17 +00:00
Roy Marples
f326f688f6
Add the -i, --interpreted option.
...
This enables the code to include the daemons interpreter when matching
process name which fixes bug #164 .
Existing init scripts that rely on the old behaviour will need to be
fixed.
2009-04-22 10:45:01 +00:00
Roy Marples
ee53e6ad29
-w, --wait seconds
...
New option so you can set the number of seconds to wait for and
check the daemon is still running.
The old code that periodically polled wasn't that reliable - in this
case simpler == better.
Fixes #160
2009-04-19 18:20:49 +00:00
Roy Marples
3579663173
Don't leak the lock fd.
2009-04-18 19:54:04 +00:00
Roy Marples
657cb3a6eb
Fix compile on FreeBSD.
2009-04-18 00:57:17 +00:00
Roy Marples
c9e24a0494
Move status to runscript.sh so init scripts can override it, #159
...
Return 32 if crashed, #163
2009-04-18 00:09:03 +00:00
Roy Marples
ee54bb9372
Using fifos for locking can be error prone.
...
flocks are safer, as we only use tmpfs for our lock files.
I don't know how this works for inactive just yet though ...
2009-04-17 22:55:11 +00:00
Roy Marples
dea9e11a69
When logging, stdout isn't always a tty, which is the case for VPS
...
systems, Thanks to mwrobel - fixes #106 .
2009-04-02 23:55:19 +00:00
Roy Marples
077b2d3ba8
Report if service is not executable.
2009-02-28 14:12:19 +00:00
Roy Marples
907ca8a89f
Set errno when service does not exist better.
2009-02-28 14:12:03 +00:00
Roy Marples
f38ef00939
Fix unit test.
2009-02-23 10:43:24 +00:00
Roy Marples
749938d439
Style.
2009-02-23 09:35:57 +00:00
Roy Marples
6cc68e21cf
Fix return value for tests.
2009-02-12 10:43:30 +00:00
Roy Marples
069590d97f
Fix unmask option, thanks to douglas@openplans.org, #146
2009-02-10 23:11:17 +00:00
Roy Marples
3fc17f5966
Store the file skewed against.
2009-02-10 15:25:28 +00:00
Roy Marples
415fe87d8c
Clean up some compiler warnings.
2009-01-29 13:29:04 +00:00
Roy Marples
417a817d25
noinit makes more sense than noinitd
2009-01-18 20:02:50 +00:00
Roy Marples
30a7a3a9bf
Fix locale with svnversion, #140 thanks to Matthias Schwarzott.
2009-01-14 14:32:56 +00:00
Roy Marples
5208a1de29
yes should be YES
2009-01-13 11:04:37 +00:00
Roy Marples
abcc4c5c72
Don't allow SYSVINIT parameters through anymore.
...
RC_REBOOT is now yes when rebooting.
Document the special reboot runlevel.
2009-01-13 11:02:00 +00:00
Roy Marples
fcf1cce549
rc_newer/older_than only report file if time_t is a pointer, so it
...
should take precedence in the argument list.
2009-01-13 09:11:31 +00:00
Roy Marples
3d37005a3d
We now warn about clock skews
...
rc-update -u will force a regen of the dep tree
rc_newer_than and rc_olderthan now take another two parameters for newest/oldest file and mtime
2009-01-12 23:53:13 +00:00
Roy Marples
a52472c3c3
Fix ordering, #139 thanks to Matthias.
2009-01-12 10:24:47 +00:00
Roy Marples
f23822e082
Copyright
2009-01-12 10:24:00 +00:00
Roy Marples
8a9a2d5fe9
Use snprintf instead of strlcpy to save on size if not available.
2009-01-12 08:31:03 +00:00
Roy Marples
a33554ab18
Copyright
2009-01-11 17:17:04 +00:00
Roy Marples
baf0ce64f5
Ensure that $HOME and $USER are always set, #139
2009-01-11 17:09:13 +00:00
Roy Marples
26f70a5277
Style
2009-01-10 12:18:00 +00:00
Roy Marples
a063035b37
Make _SVNVER_SH more readable.
2009-01-02 22:51:47 +00:00
Roy Marples
213cef1739
Fix version for releases.
2009-01-02 16:48:42 +00:00
Roy Marples
386ee57432
Fix compile, #136
2009-01-02 15:11:15 +00:00
Roy Marples
f4b8366942
Parse retry schedule correctly, #129 . Thanks to vaeth.
2008-12-28 14:05:33 +00:00
Roy Marples
7ad40abf64
Our error messages don't have full stops at the end
2008-12-23 10:42:25 +00:00
Roy Marples
7e12abe035
Typo.
2008-12-23 10:41:33 +00:00
Roy Marples
4dba5b1ff1
Disallow hotplug to run during sysinit, but allow elsewhere. Fixes #131 .
2008-12-23 10:40:27 +00:00
Roy Marples
53e2bec385
We should match on the correct args for stopping daemons when pidfiles
...
are not being used.
2008-12-23 10:15:41 +00:00
Roy Marples
803dbbf0c8
Allow rc_runlevel/softlevel to set runlevel from kernel commandline.
2008-12-21 01:15:02 +00:00
Roy Marples
9e5e60f257
Store interactive mode after sysinit, #128 thanks to Matthias Schwarzott.
2008-12-13 22:20:21 +00:00
Roy Marples
6bf0289f33
Warn about stopping sysinit services, thanks to Matthias Schwarzott. Fixes #126 .
2008-12-11 14:50:58 +00:00
Roy Marples
dc712a109e
runlevel override works correctly again.
2008-12-04 17:30:26 +00:00
Roy Marples
1acbfcf5ca
Report invalid runlevels.
2008-12-04 17:17:09 +00:00
Roy Marples
f8210050e5
If we're building from subversion, brand the binary as such.
2008-12-04 13:12:46 +00:00
Roy Marples
38e6c9ba5c
make ignore now configures the sv:ignore property.
2008-12-04 12:38:23 +00:00
Roy Marples
2c98c5326a
Punt .gitignore files.
2008-12-04 12:12:09 +00:00
Roy Marples
57f90a42ba
Include hotplugged services in our start list.
2008-12-01 08:46:50 +00:00
Roy Marples
bde35d03ed
Actally show hotplugged services.
2008-12-01 08:46:25 +00:00
Roy Marples
8b76e1d2e0
Ignore interupts when waiting for processes to finish. Also, style fixes.
2008-11-28 10:48:01 +00:00
Roy Marples
b859710cc8
Style.
2008-11-28 10:47:17 +00:00
Roy Marples
e84f71596e
Not needed.
2008-11-27 21:14:52 +00:00
Roy Marples
23e73957a0
Switch from select to poll and improve the no prefixing of eend calls.
2008-11-27 21:14:43 +00:00
Roy Marples
2537a07e10
Switch from select to poll and improve the no prefixing of eend calls.
2008-11-27 21:05:39 +00:00
Roy Marples
5403e70313
Save more screen space by removing the space befor the * for einfo and friends. Also remove the leading space before ... for ebegin.
2008-11-26 10:46:33 +00:00
Roy Marples
fe12134a5b
Don't warn about waiting for services marked as notimeout, Gentoo #247306 .
2008-11-23 18:40:43 +00:00
Roy Marples
fe509db660
Save a needless malloc when re-creating PATH.
2008-11-12 10:55:42 +00:00
Roy Marples
937b1b2abf
Don't set user info unless stated.
2008-11-11 19:47:30 +00:00
Roy Marples
eafbed0366
Fix stopping with a faulty pidfile.
2008-11-10 20:57:03 +00:00
Roy Marples
2cf24fe793
Ignore after dependencies for shutdown when not in the runlevel.
2008-11-04 09:32:21 +00:00
Roy Marples
33d4fba5be
We start off in sysinit correctly.
2008-11-04 00:21:30 +00:00
Roy Marples
32e17af92f
No need for NULL here.
2008-11-03 23:13:36 +00:00
Roy Marples
77d56f5489
Avoid depends not in the runlevel for sysinit and shutdown.
2008-11-03 23:13:12 +00:00
Roy Marples
8a76c27325
Fix sending signals, #121 .
2008-11-03 21:06:45 +00:00
Roy Marples
7467440a29
Fix fstabinfo for mounting /dev/shm, Gentoo #245367 .
2008-11-03 18:00:55 +00:00
Roy Marples
1e5a6f40e5
We shouldn't run halt.sh anymore.
2008-11-03 16:11:29 +00:00
Roy Marples
0af7d5bc20
Add a new shutdown runlevel, Gentoo #224537 .
...
Split halt.sh into halt, killprocs, romount and savecache services.
The reboot runlevel is removed but mapped to shutdown.
The halt script should be moved to the sysvinit package.
2008-11-03 15:31:01 +00:00
Roy Marples
895c4f4149
Plug a leak and expand exec also.
2008-10-30 17:57:58 +00:00
Roy Marples
20380d3144
Allow ~ and ~user to expand for chdir and chroot.
2008-10-30 17:40:48 +00:00
Roy Marples
e1341e372b
Fix --name when stopping, Gentoo #243088 .
2008-10-30 16:26:05 +00:00
Roy Marples
1c73f2967c
We no longer hotplug by default.
2008-10-30 15:03:12 +00:00
Roy Marples
2ff0838abb
We should show hotplugged services, needed services and manually started services in rc-status.
2008-10-30 14:59:14 +00:00
Roy Marples
53ddd6ca96
Properly set PAM enviornment variables after opening session.
...
Without this change, modules like pam_mktemp or pam_env and similar
will be unable to change users' environments, like they are supposed
to.
2008-10-29 21:35:45 +00:00
Roy Marples
aa991a3c99
Style.
2008-10-27 18:38:56 +00:00
Roy Marples
0d98d56188
Remove sysvinit specific code.
...
The runlevels shutdown, reboot, sysinit and single should be called by
init(8) and shutdown(8) and not manually.
sysvinit users will have to add sulogin to their inittab to secure the
console.
2008-10-27 18:01:03 +00:00
Roy Marples
0a39145a5e
Include sysinit services even in single user.
2008-10-16 17:04:44 +00:00
Roy Marples
da94fad3f5
Re-evaluate sys after running initsh.
2008-10-10 14:53:50 +00:00
Roy Marples
50b8aba8d9
Remove coldplug and just have hotplug which is a list of allowed/disallowed services. Makes things much easier.
2008-10-10 09:08:59 +00:00
Roy Marples
d6da8e8c48
sysinit is now a real runlevel that handles things like udev, dmesg and
...
mounting various bits in /dev and /sys.
init.sh JUST mounts /lib/rc/init.d (and /proc for Linux systems)
To make development of this easier we now return an empty RC_STRINGLIST
instead of a NULL for empty things.
If you don't have a udev init script installed, don't reboot your box OR
roll back to an older OpenRC version.
2008-10-10 08:37:21 +00:00
Roy Marples
c4e673edbc
Add a better, but incomplete tgoto implementation to make gcc happy.
2008-10-08 21:07:04 +00:00
Roy Marples
8c8751fa60
Clean up warnings regarding printf.
2008-10-08 15:56:47 +00:00
Roy Marples
d117b2d644
Fix tests, #Gentoo 240350.
2008-10-07 12:14:53 +00:00
Roy Marples
cb44b0a46c
#ifdef atexit cleanups calling free as the OS should do this for us, but valgrind debuggers need it.
2008-10-06 15:02:32 +00:00
Roy Marples
09a1a5ecd4
Fix a segfault when profile.env does not exist.
2008-10-03 17:50:10 +00:00
Roy Marples
41c1e170d6
Add an env var so plugins know when leaving single means the end, or start the default level.
2008-10-01 08:46:53 +00:00
Roy Marples
f53197818b
Correcly call the right runlevel for plugins when shutting down.
2008-10-01 06:10:34 +00:00
Roy Marples
bb41d2cc80
Use flock to lock PREFIX_LOCK so that multiple processes can cleanly write to the same tty.
2008-09-27 18:50:21 +00:00
Roy Marples
4291b9140e
Warn when waiting for a service every few seconds.
2008-09-27 17:17:15 +00:00
Roy Marples
28d7fb9430
When stopping services, check the newlevel if given otherwise the current runlevel. Fixes #100 .
2008-09-27 16:56:03 +00:00