William Hubbs
fe485f4433
rc: fix compiler warnings cleanup
...
This reverts commit 981d2b3308
and fixes
the warnings that generated.
2016-01-05 01:05:00 -06:00
William Hubbs
53bc986ce5
Clean default env_whitelist
...
The whitelist of environment variables we pass to service scripts
included several unnecessary variables.
The default whitelist now includes EERROR_QUIET, EINFO_QUIET,
IN_BACKGROUND and IN_HOTPLUG.
X-Gentoo-Bug: 569542
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=569542
2016-01-04 15:14:15 -06:00
William Hubbs
981d2b3308
rc: clean up compiler warnings
...
The get_systype(), detect_container(), detect_prefix() and detect_vm()
functions need to return "char *" instead of "const char *".
2016-01-01 13:13:28 -06:00
William Hubbs
000503fad7
Convert OpenRC to a centralized copyright/license structure
...
In the past, OpenRC was a hybrid of a centralized and file-scope
license/copyright structure.
I followed the instructions from the Software Freedom Law Center [1] to
convert to a Centralized structure where possible, for easier future
maintenance.
[1] https://softwarefreedom.org/resources/2012/ManagingCopyrightInformation.html
2015-12-21 12:16:06 -06:00
William Hubbs
9f6e05671d
Convert rc_sys() calls to detect_container() and detect_vm()
2015-12-08 12:09:33 -06:00
William Hubbs
8addd7913a
Create detect_container() and detect_vm() functions
...
These functions replace rc_sys so that we can detect containers and vms
separately.
Also, we copy file_regex() to rc-misc.c and open it to all operating
systems.
2015-12-08 12:05:59 -06:00
William Hubbs
eeadca0b8a
Add EERROR_QUIET and EINFO_QUIET to environment whitelist
2015-07-23 12:44:10 -05:00
Anthony G. Basile
1e0a4bebde
Bundle <sys/queue.h> from NetBSD
...
We are bundling this to allow building on musl-based systems since musl
does not include <sys/queue.h>.
2014-10-23 19:14:06 -05:00
William Hubbs
5092595835
add RC_PREFIX environment variable
...
This will be used by init scripts which want to be able to run in a
Gentoo Prefix installation. RC_PREFIX will contain the prefix offset.
2012-09-09 22:22:15 -05:00
Christian Ruppert
44019f6542
Add is_writable() function to check whether a path is writable or not
2012-01-26 20:46:31 +01:00
Mike Frysinger
d0bc4f20ad
drop useless "All rights reserved" notice
...
Signed-off-by: Mike Frysinger <vapier@gentoo.org >
2011-06-29 19:46:31 -04:00
Robin H. Johnson
2b7c2b8cf1
Bug #351570 : Hidden function fixes: rc_conf_value.
...
Refactor rc_conf_value into librc for use in library context.
Also requires moving:
- rc_conf internal static
- Defines: PROFILE_ENV, SYS_WHITELIST, USR_WHITELIST, RC_PATH_PREFIX
moved to rc.h with new RC_ prefix added.
- Defines: RC_CONF, RC_CONF_OLD moved to rc.h.
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org >
2011-01-17 19:29:45 +00:00
Robin H. Johnson
b2d0656814
Style fix: "char *foo" not "char* foo".
2011-01-17 08:46:41 +00:00
Robin H. Johnson
e6fc30da61
Clean up all trailing whitespace in src/.
2011-01-17 08:28:43 +00: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
658a220638
Add (c) to Copyright
2009-05-01 15:11:40 +01:00
Roy Marples
ade85d4bd8
Improve style for KNF
2009-04-23 21:31:22 +00:00
Roy Marples
3579663173
Don't leak the lock fd.
2009-04-18 19:54:04 +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
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
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
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
e368a4b4f8
Add missing profile bits to env, #72 .
2008-09-18 19:46:10 +00:00
Roy Marples
39ea0cb84d
Use the new rc_stringlist_find function.
2008-09-18 15:28:20 +00:00
Roy Marples
1ab1e9328a
Add -k,--umask option, Gentoo #232455 .
2008-08-20 10:02:11 +00:00
Roy Marples
dc5d63aa97
Add RC_TMPDIR so that there's a writeable location during boot.
2008-04-21 10:29:29 +00:00
Roy Marples
f0aacec02e
Cast to unsigned char for ctype calls.
2008-04-17 10:19:58 +00:00
Roy Marples
ee4e861796
Put some dir locations in rc.h so that 3rd party apps can become awware of them.
2008-03-28 10:46:12 +00:00
Roy Marples
11e33e81c8
Remove rc_service_start/stop from librc as they block and unmask signals. The application may not wish this behaviour and should fork/exec the service itself.
2008-03-28 08:42:05 +00:00
Roy Marples
15d34d0a16
Add license blurb to a few files and append my email to my name.
2008-03-26 17:53:37 +00:00
Roy Marples
cee3ccc4c1
Fix a segfault if rc.conf does not exist, Gentoo #214887
2008-03-26 15:10:26 +00:00
Roy Marples
d9ec62b22a
Add rc-service and update all softlevel refs to runlevel.
2008-03-19 17:11:50 +00:00
Roy Marples
40930d7d0a
Use correct TAILQ_CONCAT macro when not defined.
2008-03-16 17:27:13 +00:00
Roy Marples
cb9da6a262
Remove null terminated char ** lists in favour of RC_STRINGLIST, using TAILQ from queue(3). Refactor code style around the BSD KNF.
2008-03-16 17:00:56 +00:00
Roy Marples
a689b66023
Add tunable SYSCONFDIR
2008-03-05 12:27:11 +00:00
Roy Marples
ad780077d2
Welcome to 2008.
2008-02-22 12:07:34 +00:00
Roy Marples
95a7985ea3
Simply our code - only set env vars when needed.
2008-02-20 14:04:30 +00:00
Roy Marples
79d40707db
Fix compile on Linux.
2008-02-19 15:51:59 +00:00
Roy Marples
0364bb2c84
Add the nojail keyword which excludes services marked as such from the dependency tree when in a jail, #bug 22
2008-02-19 14:15:53 +00:00
Roy Marples
3620e04769
Fix an off by one error when parsing PATH
2008-02-09 18:16:53 +00:00
Roy Marples
ad04517623
Block signals to avoid fork /signal races.
2008-02-02 00:17:35 +00:00
Roy Marples
f2ce40d90b
Use sigaction over signal.
2008-02-01 13:20:19 +00:00
Roy Marples
649a710552
Quiet some more lint warnings.
2008-01-22 11:07:39 +00:00
Roy Marples
773c2b9ca6
We should never change the list passed to rc_config_value.
2008-01-18 14:01:48 +00:00
Roy Marples
87f785cc31
Style.
2008-01-18 13:30:12 +00:00
Mike Frysinger
6aab712cb4
strip trailing newlines
2008-01-14 05:05:22 +00:00
Roy Marples
87e4e4410c
Remove rc_service_plugable function and make it private as it needs to read from our config file.
2008-01-13 17:47:23 +00:00
Roy Marples
abde759d5b
Re-indent to a standard tw of 8.
2008-01-11 15:51:40 +00:00
Roy Marples
ddf25cbcb7
Compile without warnings on NetBSD
2008-01-09 23:22:04 +00:00