Compare commits

..

201 Commits

Author SHA1 Message Date
Roy Marples
30fe99dead openrc-0.2.4 2008-05-10 12:01:17 +00:00
Roy Marples
2d75eb7976 netmount may use openvpn. 2008-05-10 11:09:52 +00:00
Roy Marples
3663cf1e2a Only launch single user when RUNLEVEL == S, #74. 2008-05-10 10:04:34 +00:00
Roy Marples
766ec96e3d Add ifdown_eth0=NO so that the interface stays up for WakeOnLan, Gentoo #220875 2008-05-09 10:29:06 +00:00
Roy Marples
a854fe6d61 Simplify the wait code. 2008-05-07 09:47:07 +00:00
Roy Marples
619b0b4f37 Fix the EINTR check for waitpid, Gentoo #219929. 2008-05-06 21:53:21 +00:00
Roy Marples
c8248d05a0 Ensure that make dep ordering is correct for install. 2008-05-06 19:52:30 +00:00
Roy Marples
5ae702339e We don't need to handle SIGWINCH in sysinit, so this should fix loading a framebuffer module in init.sh (Gentoo #219929. Ideally someone should tell me why this is happening and if there is a better fix. 2008-05-06 16:21:16 +00:00
Roy Marples
d384502e57 There could be a space between #! and /sbin/runscript, Gentoo #218001. 2008-05-01 15:18:34 +00:00
Roy Marples
bdaca0baf5 Busybox find now works with -exec correctly, so remove our nasty hack. 2008-04-30 16:44:29 +00:00
Roy Marples
5188fd2592 Wups, test compiles before commiting :) 2008-04-30 16:33:54 +00:00
Roy Marples
5b800030f1 Remove redundant checking of /proc/pid/exe 2008-04-30 16:26:05 +00:00
Roy Marples
208443fa0e Save a few bytes and make it easier to read. 2008-04-30 15:26:29 +00:00
Roy Marples
a818eebf7b No need to init this. 2008-04-30 12:26:38 +00:00
Roy Marples
10910876d1 Make the function a little smaller. 2008-04-30 10:55:42 +00:00
Roy Marples
35b4978152 Style 2008-04-30 10:31:06 +00:00
Roy Marples
cedd81801a We should use correct iproute2 commands and fix busybox as it's iproute2 implementation is a little broken. 2008-04-30 09:18:20 +00:00
Roy Marples
e273b4e08e Fix another leak. 2008-04-29 11:08:02 +00:00
Roy Marples
50cff8ebc8 Tweak the last commit and fix a valgrind error. 2008-04-29 10:49:50 +00:00
Roy Marples
aec83494d6 Merge branch 'master' of git@git.overlays.gentoo.org:proj/openrc 2008-04-29 10:26:17 +00:00
Roy Marples
5ba6f0a628 We need to ensure that the init script started is correct, translating symlinks. This has a new rule - multiplexed services must exist in the same dir as the master sript. So we need to ensuret that net.lo(0) is the real script and not a symlink itself. This fixes Gentoo #219526. 2008-04-29 10:25:45 +00:00
Roy Marples
5a59542629 Fix syscons for setting the font correctly. 2008-04-29 08:00:50 +00:00
Roy Marples
52711bdca7 Release openrc-0.2.3 2008-04-28 18:39:51 +00:00
Roy Marples
53902cefb8 Add rc_program function which uses fork and signal masking to try and resolve the waitpid issue, Gentoo #219179. 2008-04-28 16:04:16 +00:00
Roy Marples
75f991068d Fix multi platform a little. 2008-04-28 12:48:20 +00:00
Roy Marples
e499e58310 Don't re-start or re-stop failed services if runlevel is changing. 2008-04-27 21:04:37 +00:00
Roy Marples
b08b6cd91b Always define template start/stop functions so that the real script name isn't hidden when errors are in the real start/stop functions, Gentoo #219179 2008-04-26 19:32:28 +00:00
Roy Marples
3c2b93fc9c Check we have a list before running depends. 2008-04-26 14:59:07 +00:00
Roy Marples
b5d829789f Check we have a list before running depends. 2008-04-26 14:57:39 +00:00
Roy Marples
1e3442f95d Work with aliases on NetBSD. 2008-04-23 13:17:13 +00:00
Roy Marples
2bda1871a1 When fsck_passno is set, show this so output is clearer when fsck is multiplexed, Gentoo #218141. 2008-04-22 13:46:53 +00:00
Roy Marples
d3b111bd58 Our init scripts normally output context in [ .. ] 2008-04-22 08:12:26 +00:00
Roy Marples
dbea63b76d Fix logic for templates. 2008-04-21 21:34:52 +00:00
Roy Marples
6a5287dbb5 Typo 2008-04-21 19:26:56 +00:00
Roy Marples
df8eeba2fb Punt is_function in favour of POSIX shell builtin command, thanks to Harald van Dijk for the idea. 2008-04-21 17:32:17 +00:00
Roy Marples
54fce42c6f Merge branch 'master' of git@git.overlays.gentoo.org:proj/openrc 2008-04-21 13:07:04 +00:00
Roy Marples
54d7aa39dd If we don't have permission to inspect the pidfile, don't report crashed. Gentoo #218028. 2008-04-21 10:56:28 +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
bab5d7767d Merge branch 'master' of git@git.overlays.gentoo.org:proj/openrc 2008-04-21 10:26:40 +00:00
Roy Marples
799686e40d Fix force_preferred, #60. 2008-04-20 14:24:35 +00:00
Roy Marples
d83ae59cca Add help for mountargs, #63 2008-04-19 17:19:59 +00:00
Mike Frysinger
18b4108755 add support for parsing newer ifconfig output
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2008-04-19 07:22:30 +00:00
Roy Marples
e96347523f We should check type output to ensure that we're really calling a shell function and not some badly named binary like stop from boinc, Gentoo #218063. 2008-04-18 23:00:43 +00:00
Roy Marples
f0aacec02e Cast to unsigned char for ctype calls. 2008-04-17 10:19:58 +00:00
Roy Marples
57e1dd7389 Fix rc-status some more. 2008-04-17 00:25:08 +00:00
Roy Marples
c89b3763fb Respect shutdown -F on Linux to force fsck, #59 2008-04-17 00:09:34 +00:00
Roy Marples
425abe40c5 Only report unassigned services when there are any, Gentoo #218005. 2008-04-16 19:47:19 +00:00
Roy Marples
725b9dc89c Use qlen instead of txqueuelen so we work with busybox iproute2, Gentoo #217948 2008-04-16 15:23:57 +00:00
Roy Marples
22d650c450 Merge branch 'master' of git@git.overlays.gentoo.org:proj/openrc 2008-04-16 15:02:19 +00:00
Roy Marples
809ac86c69 We should only check dependencies in files. 2008-04-16 15:01:52 +00:00
Roy Marples
b3310e8e10 Fix rebooting for OpenVZ systems. 2008-04-15 21:50:08 +00:00
Roy Marples
29369c44c1 Add help text for rc-service --resole. 2008-04-15 16:16:59 +00:00
Roy Marples
292fe3a568 Release 0.2.2 2008-04-15 16:09:02 +00:00
Roy Marples
99d5046a56 Don't assume that we have a list returned. 2008-04-10 08:49:05 +00:00
Roy Marples
0e38dcc4d2 By default, rc-status now shows the statuses of the services in the current runlevel and any unassigned non stopped services, #52. 2008-04-09 22:56:32 +00:00
Roy Marples
9176b77c23 Merge branch 'master' of git@git.overlays.gentoo.org:proj/openrc 2008-04-09 19:02:41 +00:00
Roy Marples
fad61a7c4b Fix windowkeys. 2008-04-09 12:24:34 +00:00
Roy Marples
0e114abf5d Respect shutdown's fastboot. 2008-04-09 00:21:49 +00:00
Roy Marples
bc369085c7 More ltsp fixes. 2008-04-09 00:06:50 +00:00
Roy Marples
6d8b36e09d Fix netmout for nfs 2008-04-08 23:25:48 +00:00
Roy Marples
8759735711 Give an error when running zap as a generic user. 2008-04-08 22:57:42 +00:00
Roy Marples
034b9b7a12 Add a silly rc_runlevel function to appease SpanKY :) 2008-04-08 16:01:40 +00:00
Roy Marples
e82435c2f4 rc_runlevel is now the preferred kernel commandline option for choosing default runlevel. 2008-04-08 15:59:56 +00:00
Roy Marples
71dd280656 Fix rc-service --help output. 2008-04-07 11:48:32 +00:00
Roy Marples
594d98eddc Tests now work on NetBSD. 2008-04-07 09:37:14 +00:00
Roy Marples
dcdfdb442f Some systems are only detectable after /proc is mounted, so re-test if unknown. 2008-04-06 20:06:07 +00:00
Roy Marples
143239e143 Increase pidstr size to 10 chars. 2008-04-06 13:24:10 +00:00
Roy Marples
5d38d4d6e9 p could be null here. 2008-04-06 13:21:42 +00:00
Roy Marples
c18c4fc4cc Check list existance before iterating, Gentoo #216091. 2008-04-04 16:31:56 +00:00
Roy Marples
5ebe7f1349 Push out 0.2.1 to solve a few issues. 2008-04-02 16:35:28 +00:00
Roy Marples
6a227d0c45 Merge branch 'master' of git@git.overlays.gentoo.org:proj/openrc 2008-04-02 16:35:02 +00:00
Roy Marples
403abe73de Fix vlans, #49. 2008-04-01 21:34:31 +00:00
Roy Marples
be82e950d7 Merge branch 'master' of git@git.overlays.gentoo.org:proj/openrc 2008-03-31 16:31:43 +00:00
Roy Marples
3ca8387966 Document SSD_NICELEVEL. 2008-03-29 09:37:59 +00:00
Roy Marples
f5a9b42215 Restore noserver and noopenvz to sysctl. 2008-03-28 19:05:26 +00:00
Roy Marples
d370918f0c Merge branch 'master' of git@git.overlays.gentoo.org:proj/openrc 2008-03-28 16:21:59 +00:00
Roy Marples
e995404e3b Add XEN support to NetBSD. 2008-03-28 16:10:31 +00:00
Roy Marples
caa4704ce6 Merge branch 'master' of git@git.overlays.gentoo.org:proj/openrc 2008-03-28 16:05:11 +00:00
Roy Marples
17d28fde42 Support XEN on NetBSD 2008-03-28 16:04:48 +00:00
Roy Marples
b418f2e471 Allow our headers to be included by C++ programs easily. 2008-03-28 11:06:47 +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
5e8ed2aeca Tweak install of runlevels. 2008-03-27 19:55:03 +00:00
Roy Marples
742310744d We would sanitize $RC_LIBDIR/sbin as well. If it's really needed then rc-functions.sh will add it back. 2008-03-27 18:34:12 +00:00
Roy Marples
4e9b58b07d Sanitize the write rc dir. 2008-03-27 17:09:18 +00:00
Roy Marples
c564043f86 No need for the extra rc. 2008-03-27 16:59:33 +00:00
Roy Marples
b3d1182a2f Fix mulitlib issues. 2008-03-27 16:53:22 +00:00
Roy Marples
f6cb321f9f NetBSD doesn't work with this powerd. 2008-03-27 14:56:50 +00:00
Roy Marples
f85c6ca84c Make our messages similar 2008-03-27 14:03:37 +00:00
Roy Marples
d09f9f47eb Split terminal encoding out. 2008-03-27 13:49:49 +00:00
Roy Marples
b271ac5af5 Fix install of rc and rc.shutdown on the BSD's. 2008-03-27 09:33:20 +00:00
Roy Marples
fccff6a4ed Allow multiple ntp_servers without error, #47 2008-03-26 22:39:27 +00:00
Roy Marples
a1d555bdc4 Release 0.2 2008-03-26 19:58:43 +00:00
Roy Marples
ecba32d1ca Install ifwatchd for NetBSD. 2008-03-26 19:39:43 +00:00
Roy Marples
a718975e08 Add license blurb to a few files and append my email to my name. 2008-03-26 17:55:35 +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
864e17fabc Ignore more files. 2008-03-26 17:34:23 +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
f90f2914b9 Add mising net files back. 2008-03-26 14:41:47 +00:00
Roy Marples
ac834ddc56 Fix linux compile. 2008-03-26 14:39:13 +00:00
Roy Marples
8e71c03495 No more need for SUBOS 2008-03-26 14:29:27 +00:00
Roy Marples
833903fc78 use $CP and $SED instead of cp and sed 2008-03-26 14:27:46 +00:00
Roy Marples
ccf238f852 Merge net.OS into net 2008-03-26 14:18:01 +00:00
Roy Marples
55858eca2e .sh.BSD.in is a better extension. 2008-03-26 14:02:59 +00:00
Roy Marples
ac037241a7 Merge doc dirs. 2008-03-26 13:59:06 +00:00
Roy Marples
6af2b20297 Split sysctl into Linux and BSD specific files. 2008-03-26 09:36:34 +00:00
Roy Marples
1b40379a79 We should sort using LC_ALL=C to avoid locale issues. 2008-03-26 08:43:05 +00:00
Roy Marples
be1f9b0a93 Add --exists and --resolve to rc-service. 2008-03-26 08:08:47 +00:00
Roy Marples
e30ea10e6c Fix some more prefix stuff. 2008-03-26 05:08:56 +00:00
Roy Marples
3f37d4771b If we have coldplugged services, but no start_services, we need to create a new list for start_services. 2008-03-26 05:08:38 +00:00
Roy Marples
4f4b74e110 Check the right dir for installed scripts. 2008-03-26 04:48:39 +00:00
Roy Marples
f06e186d43 Fix mandir install. 2008-03-25 20:39:31 +00:00
Roy Marples
5866d829bb Try and fix more prefix stuff. 2008-03-25 18:33:45 +00:00
Roy Marples
068c90c82b Fix exclusive removal. 2008-03-25 18:20:23 +00:00
Roy Marples
59b27ad7eb Fix man install. 2008-03-25 17:37:54 +00:00
Roy Marples
85b480a6f2 Tweak man install. 2008-03-25 17:32:19 +00:00
Roy Marples
ae9ce04468 Allow MANPREFIX to work. 2008-03-25 17:24:54 +00:00
Roy Marples
c807b3a815 INITDIR should already be prefixed. 2008-03-25 17:19:41 +00:00
Roy Marples
4d6b84290a These now need to be prefixed. 2008-03-25 17:17:15 +00:00
Roy Marples
08791ec4a2 INITDIR should already be prefixed. 2008-03-25 17:11:44 +00:00
Roy Marples
a99b8d349c SYSCONFDIR should already be prefixed. 2008-03-25 17:09:56 +00:00
Roy Marples
74bff8a931 DIR should be prefixed already. 2008-03-25 16:59:26 +00:00
Roy Marples
a2a7f0740e Install swap-blk on NetBSD. 2008-03-25 16:40:49 +00:00
Roy Marples
9b2f7bce99 Fix FreeBSD makefile. 2008-03-25 16:25:12 +00:00
Roy Marples
3d0fc150dc Fix sysctl on Linux and BSD. 2008-03-25 14:35:52 +00:00
Roy Marples
fc7e6a3ada Fix module args per kernel version. 2008-03-25 14:35:36 +00:00
Roy Marples
748ddf28ed Include Os Makefile. 2008-03-25 14:15:54 +00:00
Roy Marples
55eb3794fb Rework our folder structure so that we don't have OS specific dirs, making it easier to share init and conf files per OS. 2008-03-25 14:06:05 +00:00
Roy Marples
08aff6ef44 Allow per kernel version module arguments. 2008-03-25 08:31:48 +00:00
Roy Marples
0347f01345 Fix segfault when no coldplugged services, thanks to Daijo. 2008-03-24 13:30:24 +00:00
Roy Marples
5a80daaf43 Fix coldplug disabling. 2008-03-24 13:09:42 +00:00
Roy Marples
64332a3675 Add debug.mk 2008-03-24 11:52:01 +00:00
Roy Marples
821166fbfd Fix debug support to work without gmake and bundle -ggdb in properly. 2008-03-24 11:43:03 +00:00
Roy Marples
79719b5386 Fix adding services to the boot runlevel, #43 2008-03-24 10:13:49 +00:00
Mike Frysinger
486d517674 setup a bit of a test framework 2008-03-24 07:17:05 +00:00
Mike Frysinger
1c9c2f9fcf fixup testing 2008-03-24 06:30:21 +00:00
Mike Frysinger
7b08276fa8 add missing rc_stringlist_new/rc_sys hidden defs 2008-03-24 06:24:46 +00:00
Mike Frysinger
58caa0864f ignore generated files 2008-03-24 06:18:51 +00:00
Mike Frysinger
9ed5d28d15 add check/test rules 2008-03-24 06:10:40 +00:00
Mike Frysinger
02e7e1b988 dont leak the _e var 2008-03-24 05:54:18 +00:00
Roy Marples
a1b9768243 Fix returning a service descriptions. 2008-03-23 22:58:25 +00:00
Roy Marples
06635dedbc We don't change service here. 2008-03-23 22:57:56 +00:00
Roy Marples
2715981ff9 Revert commit 48fc097e39ec9b3edd9a8929fe9faf8f302451ec and add a comment about making it a runtime config option if it needs to change. 2008-03-23 20:04:18 +00:00
Roy Marples
ce644e1735 Report mounts in reverse order, Gentoo #214150. 2008-03-23 19:51:41 +00:00
Mike Frysinger
ec4721dd7f fix spacing in the trailing [ msg ] 2008-03-23 12:49:40 +00:00
Mike Frysinger
e1b09daaac fix broken whitespace -- no functional changes 2008-03-23 12:24:15 +00:00
Mike Frysinger
bd34df6361 add support for automatic gdb launching when RC_DEBUG is defined to 1 to ease bug reporting / information gathering 2008-03-22 23:02:30 +00:00
Mike Frysinger
7beafe361a ignore gdb files 2008-03-22 23:01:06 +00:00
Mike Frysinger
5dcdfcdf7a add local rpaths if in the git tree 2008-03-22 23:00:32 +00:00
Roy Marples
a4f9eb699b Fix some crashers in a prefix with few services. 2008-03-21 20:02:10 +00:00
Roy Marples
f7f3b6ae09 euid 0 should always be able to find pids too. 2008-03-21 17:41:01 +00:00
Roy Marples
f6b47568ad Merge branch 'master' of git@git.overlays.gentoo.org:proj/openrc 2008-03-21 13:04:57 +00:00
Roy Marples
85a6addd23 Only test crashed services if we can see pid 1. 2008-03-21 13:04:29 +00:00
Roy Marples
4079b4d65d Clean up error display. 2008-03-21 11:20:03 +00:00
Roy Marples
eca292e5d9 Some OS's block on umount -f, so don't use it. 2008-03-21 11:02:02 +00:00
Roy Marples
fe90a548b5 ksoftlevel -> krunlevel 2008-03-21 10:34:09 +00:00
Roy Marples
494fb0a5f6 Add --list to rc-service to list all available services. 2008-03-21 09:10:59 +00:00
Roy Marples
e505e6ea41 We should only free the buffer when done reading the dir. 2008-03-21 08:31:04 +00:00
Roy Marples
e47661449a More pathing fixes. 2008-03-21 00:30:22 +00:00
Roy Marples
04b0acb010 Fix pathing again. 2008-03-20 19:57:31 +00:00
Roy Marples
e598b7d2cd Tweak install. 2008-03-20 17:52:07 +00:00
Roy Marples
ec2d39d024 Just warn about the incorrect service. Let the right service be more explanitory about missing options. 2008-03-19 22:26:45 +00:00
Roy Marples
3b888b385a gitignore 2008-03-19 22:17:10 +00:00
Roy Marples
eea30772d4 Fix last commit. 2008-03-19 22:11:22 +00:00
Roy Marples
d948e65d60 Give a better error message when no service specified. 2008-03-19 20:04:48 +00:00
Roy Marples
97abd91577 Report wrong service correctly. 2008-03-19 20:01:48 +00:00
Roy Marples
5f091395c7 Typo. 2008-03-19 19:59:50 +00:00
Roy Marples
6159a32f39 SVCNAME -> RC_SVCNAME, but export SVCNAME still for compat. 2008-03-19 19:57:24 +00:00
Roy Marples
6d2e1f7add Fix building on Linux. 2008-03-19 19:43:08 +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
089caec283 Add missing .mks 2008-03-19 15:38:05 +00:00
Roy Marples
64853c4916 Rejig the build system a little so we have per ok defs per system. Probably easier in the long run. 2008-03-19 15:22:20 +00:00
Roy Marples
0e6eb0f764 Ensure that our path includes packages and local 2008-03-19 15:21:42 +00:00
Roy Marples
f69013adbe Fix define name 2008-03-19 15:15:09 +00:00
Roy Marples
1443fee901 Fix errors when reporting who we are scheduled by. 2008-03-19 12:26:47 +00:00
Roy Marples
cdd3881c1b Return scheduled services correctly. 2008-03-19 12:26:09 +00:00
Roy Marples
773d50dabb Get going_down and parallel the right away round. 2008-03-18 23:06:02 +00:00
Roy Marples
7b8215bbd3 Support pam_mktemp. 2008-03-18 08:19:29 +00:00
Roy Marples
51c825ceee Make rc_getline private and save it's buffer so it's sort of like getline from glibc. 2008-03-17 21:27:37 +00:00
Roy Marples
b9eb450696 Fix some tests on FreeBSD. 2008-03-17 17:57:07 +00:00
Roy Marples
c74cfabe2e init some vars. 2008-03-17 16:42:31 +00:00
Roy Marples
5d77c0db6b This should be a fixed buffer. 2008-03-17 14:42:10 +00:00
Roy Marples
b2f7606b23 We should check for NULL here. 2008-03-17 14:31:44 +00:00
Roy Marples
4c14666423 Punt the rc_strcatpaths function and use snprintf instead to save on expensive malloc calls. 2008-03-17 13:25:56 +00:00
Roy Marples
50a7697bf2 rc_find_pids now returns RC_PIDLIST instead of a NULL terminated array. 2008-03-17 09:59:52 +00:00
Roy Marples
40930d7d0a Use correct TAILQ_CONCAT macro when not defined. 2008-03-16 17:27:13 +00:00
Roy Marples
1fd1472dde Add new stringlist files. 2008-03-16 17:01:35 +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
40e12f6ba0 RC_SERVICE now points to the service file, so daemons can recall us directly. 2008-03-11 15:00:16 +00:00
Roy Marples
568ec5f343 Don't state the fstype we're using as fstab could be totally different. 2008-03-11 13:55:39 +00:00
Roy Marples
6f68c44a77 mount may not be in /sbin 2008-03-11 13:51:06 +00:00
Roy Marples
b7c0d8b43c Remove debug LDFLAGS 2008-03-11 13:45:58 +00:00
Roy Marples
52a3cc162b Add a --mount command to fstabinfo so it can mount specific mount points, as mount can get confused with binded mounts, bug #36. 2008-03-11 13:39:20 +00:00
Roy Marples
0fa512c2b5 Coldplug net devices on the BSD's as found by getifaddrs. 2008-03-11 11:03:34 +00:00
Roy Marples
656b79b51e Fix getting MAC address on NetBSD. 2008-03-11 00:04:49 +00:00
Roy Marples
8b23aaecff Add ifwatchd.sh to power the NetBSD ifwatchd program. Let wpa_supplicant work with it. 2008-03-10 21:34:46 +00:00
Roy Marples
f20099bc33 Fix the old RC_USE names. 2008-03-10 11:33:39 +00:00
Roy Marples
a276050a54 Use correct shell_var function, Gentoo bug #212877 2008-03-10 08:56:28 +00:00
Roy Marples
c4a54605e0 Support baselayout-2 uppercase RC_NEED vars, #38. 2008-03-08 15:22:29 +00:00
Roy Marples
df1377601b We don't mount /lib/rc/init.d when / is rw at boot. 2008-03-08 15:18:53 +00:00
Roy Marples
4742e1ec69 d_type is not portable across filesystems. 2008-03-08 13:06:29 +00:00
237 changed files with 7023 additions and 6703 deletions

2
.gitignore vendored
View File

@@ -1 +1,3 @@
openrc-0.1.tar.bz2
.gdb_history
.gdbinit

View File

@@ -1,9 +1,9 @@
# OpenRC Makefile
# Copyright 2007-2008 Roy Marples
# Distributed under the terms of the GNU General Public License v2
# Copyright 2007-2008 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.
NAME= openrc
VERSION= 0.1
VERSION= 0.2.4
PKG= ${NAME}-${VERSION}
SUBDIR= conf.d doc etc init.d man net sh src

View File

@@ -1,5 +0,0 @@
DIR= ${CONFDIR}
CONF= localmount moused powerd rarpd
MK= ../mk
include ${MK}/scripts.mk

View File

@@ -1,5 +0,0 @@
DIR= ${CONFDIR}
CONF= syscons
MK= ../mk
include ${MK}/scripts.mk

View File

@@ -1,6 +0,0 @@
DIR= ${CONFDIR}
CONF= consolefont keymaps modules
CONF_APPEND= clock
MK= ../mk
include ${MK}/scripts.mk

View File

@@ -1,9 +0,0 @@
# Set clock_adjtime if you wish hwclock to try and handle clock drift.
# Don't set this if you run a ntp service or anything else that handles
# clock drift.
clock_adjtime="NO"
# If you wish to pass any other arguments to hwclock during bootup,
# you may do so here. Alpha users may wish to use --arc or --srm here.
clock_args=""

View File

@@ -1,5 +1,7 @@
DIR= ${CONFDIR}
CONF= bootmisc clock fsck hostname local net urandom
CONF= bootmisc fsck hostname local net urandom
MK= ../mk
include ${MK}/os.mk
include Makefile.${OS}
include ${MK}/scripts.mk

1
conf.d/Makefile.FreeBSD Normal file
View File

@@ -0,0 +1 @@
CONF+= moused powerd rarpd savecore syscons

1
conf.d/Makefile.Linux Normal file
View File

@@ -0,0 +1 @@
CONF+= consolefont hwclock keymaps modules

1
conf.d/Makefile.NetBSD Normal file
View File

@@ -0,0 +1 @@
CONF+= moused rarpd savecore

14
conf.d/hwclock Normal file
View File

@@ -0,0 +1,14 @@
# Set CLOCK to "UTC" if your system clock is set to UTC (also known as
# Greenwich Mean Time). If your clock is set to the local time, then
# set CLOCK to "local". Note that if you dual boot with Windows, then
# you should set it to "local".
clock="UTC"
# If you want to set the Hardware Clock to the current System Time
# during shutdown, then say "YES" here.
# You normally don't need to do this if you run a ntp daemon.
clock_systohc="NO"
# If you wish to pass any other arguments to hwclock during bootup,
# you may do so here. Alpha users may wish to use --arc or --srm here.
clock_args=""

View File

@@ -5,8 +5,11 @@
#modules_2_6="tun"
#modules="ohci1394"
# Give the modules some arguments if needed.
# module_ieee1394_args="debug"
# Give the modules some arguments if needed, per version if necessary.
#module_ieee1394_args="debug"
#module_ieee1394_args_2_6_23_gentoo_r5="ieee1394 ohci1394"
#module_ieee1394_args_2_6_23="tun ieee1394"
#module_ieee1394_args_2_6="tun"
# You should consult your kernel documentation and configuration
# for a list of modules and their options.

View File

@@ -1,29 +1,25 @@
# Kernel core dump options for FreeBSD kernel.
# Unless you're a FreeBSD kernel developer or driver writer then this won't
# Unless you're a kernel developer or driver writer then this won't
# be of any interest to you at all.
# The following options allow to configure the kernel's core dump
# facilities. Please read
# http://www.freebsd.org/doc/en_US.ISO8859-1/books/developers-handbook/kerneldebug.html
# for more information about Kernel core dumps and kernel debugging.
# facilities.
# KERNEL_DUMP_DEVICE variable is used to specify which device will be
# The dump_device variable is used to specify which device will be
# used by the kernel to write the dump down. This has to be a swap
# partition, and has to be at least big enough to contain the whole
# physical memory (see hw.physmem sysctl(8) variable).
# When the variable is commented out, no core dump will be enabled for
# the kernel.
#KERNEL_DUMP_DEVICE="/dev/ad0s1b"
#dump_device=/dev/ad0s1b
# KERNEL_DUMP_DIR variable is used to tell savecore(8) utility where
# The dump_dir variable is used to tell savecore(8) utility where
# to save the kernel core dump once it's restored from the dump
# device. If unset, /var/crash will be used, as the default of
# FreeBSD.
#KERNEL_DUMP_DIR="/var/crash"
#dump_dir=/var/crash
# KERNEL_DUMP_COMPRESS variable decide whether to compress with
# The dump_compress variable decide whether to compress with
# gzip(1) the dump or leave it of its original size (the size of the
# physical memory present on the system). If set to yes, the -z option
# will be passed to savecore(8) that will proceed on compressing the
# dump.
#KERNEL_DUMP_COMPRESS="NO"
#dump_compress=NO

View File

@@ -1,5 +0,0 @@
DIR= ${DOCDIR}/openrc
INC= net.example
MK= ../mk
include ${MK}/scripts.mk

1
doc/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
net.example

View File

@@ -2,4 +2,6 @@ DIR= ${DOCDIR}/openrc
INC= net.example
MK= ../mk
include ${MK}/os.mk
include Makefile.${OS}
include ${MK}/scripts.mk

5
doc/Makefile.FreeBSD Normal file
View File

@@ -0,0 +1,5 @@
SRCS+= net.example.in
.SUFFIXES: .BSD.in
.BSD.in:
${CP} $< $@

5
doc/Makefile.Linux Normal file
View File

@@ -0,0 +1,5 @@
SRCS+= net.example.in
.SUFFIXES: .Linux.in
.Linux.in:
${CP} $< $@

5
doc/Makefile.NetBSD Normal file
View File

@@ -0,0 +1,5 @@
SRCS+= net.example.in
.SUFFIXES: .BSD.in
.BSD.in:
${CP} $< $@

View File

@@ -87,6 +87,10 @@
# is how long we wait for carrier. The current default is 3 seconds
#carrier_timeout_eth0=-1
# You may wish to disable the interface being brought down when stopping.
# This is only of use for WakeOnLan.
#ifdown_eth0="NO"
##############################################################################
# OPTIONAL MODULES

View File

@@ -120,6 +120,10 @@
# tables you may have to set a global metric as the due to a simple read of
# the routing table taking over a minute at a time.
# You may wish to disable the interface being brought down when stopping.
# This is only of use for WakeOnLan.
#ifdown_eth0="NO"
##############################################################################
# OPTIONAL MODULES

View File

@@ -1,10 +0,0 @@
DIR= ${SYSCONFDIR}
CONF= rc rc.shutdown
MK= ../mk
include ${MK}/scripts.mk
include Makefile.${OS}
.SUFFIXES: .in
.in:
sed -e 's:@SHELL@:${SHELL}:' -e 's:@TERM@:${DEFTERM}:' $< > $@

View File

@@ -1 +0,0 @@
DEFTERM= cons25

View File

@@ -1 +0,0 @@
DEFTERM= wsvt25

View File

@@ -1,6 +0,0 @@
DIR= /etc
CONF= devd.conf
BIN= rc.devd
MK= ../mk
include ${MK}/scripts.mk

View File

@@ -1,5 +0,0 @@
DIR= ${SYSCONFDIR}
CONF_APPEND= rc.conf
MK= ../mk
include ${MK}/scripts.mk

View File

@@ -1,2 +1,3 @@
rc.conf
rc
rc.shutdown

View File

@@ -2,4 +2,6 @@ DIR= ${SYSCONFDIR}
CONF= rc.conf
MK= ../mk
include ${MK}/os.mk
include Makefile.${OS}
include ${MK}/scripts.mk

4
etc/Makefile.FreeBSD Normal file
View File

@@ -0,0 +1,4 @@
SED_EXTRA= -e 's:@TERM@:cons25:g'
SRCS+= rc.conf.in rc.in rc.shutdown.in
CONF+= devd.conf
BIN+= rc rc.shutdown rc.devd

6
etc/Makefile.Linux Normal file
View File

@@ -0,0 +1,6 @@
SED_EXTRA= -e 's:@TERM@:wsvt25:g'
SRCS+= rc.in rc.shutdown.in
rc.conf:
cp rc.conf.in rc.conf
cat rc.conf.Linux >> rc.conf

3
etc/Makefile.NetBSD Normal file
View File

@@ -0,0 +1,3 @@
SED_EXTRA= -e 's:@TERM@:wsvt25:g'
SRCS+= rc.conf.in rc.in rc.shutdown.in
BIN+= rc rc.shutdown

10
init.d.BSD/.gitignore vendored
View File

@@ -1,10 +0,0 @@
hostid
moused
newsyslog
pf
rarpd
rc-enabled
rpcbind
savecore
sysctl
syslogd

View File

@@ -1,7 +0,0 @@
DIR= ${INITDIR}
SRCS= hostid.in moused.in newsyslog.in pf.in rarpd.in rc-enabled.in \
rpcbind.in savecore.in sysctl.in syslogd.in
BIN= ${OBJS}
MK= ../mk
include ${MK}/scripts.mk

View File

@@ -1,8 +0,0 @@
clock
devd
dumpon
ipfw
mixer
nscd
powerd
syscons

View File

@@ -1,6 +0,0 @@
DIR= ${INITDIR}
SRCS= clock.in devd.in dumpon.in ipfw.in mixer.in nscd.in powerd.in syscons.in
BIN= ${OBJS}
MK= ../mk
include ${MK}/scripts.mk

View File

@@ -1,8 +0,0 @@
clock
consolefont
keymaps
modules
mtab
numlock
procfs
sysctl

View File

@@ -1,7 +0,0 @@
DIR= ${INITDIR}
SRCS= clock.in consolefont.in keymaps.in modules.in mtab.in numlock.in \
procfs.in sysctl.in
BIN=${OBJS}
MK= ../mk
include ${MK}/scripts.mk

View File

@@ -1,3 +0,0 @@
swap-blk
ttys
wscons

View File

@@ -1,6 +0,0 @@
DIR= ${INITDIR}
SRCS= swap-blk.in ttys.in wscons.in
BIN= ${OBJS}
MK= ../mk
include ${MK}/scripts.mk

View File

@@ -3,5 +3,8 @@ SRCS= avahi-dnsconfd.in avahid.in dbus.in hald.in named.in ntpd.in \
openvpn.in polkitd.in sshd.in
MK= ../mk
SED_EXTRA+= -e 's:@VARBASE@:/var:g'
include ${MK}/scripts.mk
include Makefile.${OS}

View File

@@ -3,7 +3,7 @@
# All rights reserved. Released under the 2-clause BSD license.
command=@PKG_PREFIX@/bin/dbus-daemon
pidfile=@VARBASE@/run/dbus/dbus.pid
pidfile=@VARBASE@/run/dbus/pid
command_args="${dbusd_args---system}"
name="Message Bus Daemon"
@@ -15,5 +15,5 @@ depend()
start_pre()
{
mkdir -p $(dirname $pidfile)
mkdir -p $(dirname $pidfile)
}

View File

@@ -18,7 +18,7 @@ depend()
reload()
{
ebegin "Reloading ${SVCNAME}"
ebegin "Reloading ${RC_SVCNAME}"
start-stop-daemon --signal SIGHUP --pidfile "${pidfile}"
eend $?
}

View File

@@ -4,12 +4,22 @@
command=/usr/sbin/named
command_args=${named_args}
pidfile=@VARBASE@/run/named/pid
pidfile=@VARBASE@/run/named.pid
name="Domain Name server"
extra_started_commands="reload"
namedb=/etc/namedb
named_uid=${named_uid:-bind}
uid=named
case "${RC_UNAME}" in
FreeBSD)
uid=bind
pidfile=@VARBASE@/run/named/pid
;;
Linux)
uid=bind
;;
esac
named_uid=${named_uid:-${uid}}
depend()
{
@@ -62,7 +72,7 @@ start_pre()
# Copy local timezone information if it is not up to date.
if [ -r /etc/localtime ]; then
cmp -s /etc/localtime "${named_chroot}/etc/localtime" ||
cp -p /etc/localtime "${named_chroot}/etc/localtime"
cp -p /etc/localtime "${named_chroot}/etc/localtime"
fi
command_args="${command_args} -t ${named_chroot}"
@@ -72,7 +82,7 @@ start_pre()
if [ ! -s "${named_chroot}${namedb}/rndc.conf" ]; then
local confgen="${command%/named}/rndc-confgen -a -b256 -u ${named_uid} \
-c ${named_chrootdir}/etc/namedb/rndc.key"
-c ${named_chrootdir}/etc/namedb/rndc.key"
if [ -s "${named_chroot}${namedb}/rndc.key" ]; then
local getuser="stat -f%Su"
[ "${RC_UNAME}" = "Linux" ] && getuser="stat -c%U"

View File

@@ -2,12 +2,12 @@
# Copyright 2007-2008 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.
vpn=${SVCNAME#*.}
vpn=${RC_SVCNAME#*.}
name="OpenVPN"
[ "${vpn}" != "openvpn" ] && name="${name} (${vpn})"
command=@PKG_PREFIX@/sbin/openvpn
pidfile=@VARBASE@/run/"${SVCNAME}".pid
pidfile=@VARBASE@/run/"${RC_SVCNAME}".pid
openvpn_dir=${openvpn_dir:-@PKG_PREFIX@/etc/openvpn}
openvpn_config=${openvpn_config:-${openvpn_dir}/${vpn}.conf}
command_args="${openvpn_args} --daemon --config ${openvpn_config} --writepid ${pidfile}"

30
init.d/.gitignore vendored
View File

@@ -7,4 +7,34 @@ localmount
netmount
root
swap
sysctl
urandom
hostid
moused
newsyslog
pf
rarpd
rc-enabled
rpcbind
savecore
syslogd
adjkerntz
devd
dumpon
ipfw
mixer
nscd
powerd
syscons
net.lo
ttys
swap-blk
wscons
consolefont
hwclock
keymaps
modules
mtab
numlock
procfs
termencoding

View File

@@ -1,7 +1,16 @@
DIR= ${INITDIR}
SRCS= bootmisc.in fsck.in halt.sh.in hostname.in local.in localmount.in \
netmount.in root.in swap.in urandom.in
netmount.in root.in swap.in sysctl.in urandom.in
BIN= ${OBJS}
INSTALLAFTER= _installafter
CLEANFILES+= net.lo
TARGETS+= net.lo
MK= ../mk
include ${MK}/os.mk
include Makefile.${OS}
include ${MK}/scripts.mk
_installafter: realinstall
${INSTALL} -m ${BINMODE} net.lo ${DESTDIR}/${INITDIR}/${NET_LO}

13
init.d/Makefile.FreeBSD Normal file
View File

@@ -0,0 +1,13 @@
NET_LO= net.lo0
# Generic BSD scripts
SRCS+= hostid.in moused.in newsyslog.in pf.in rarpd.in rc-enabled.in \
rpcbind.in savecore.in syslogd.in
# These are FreeBSD specific
SRCS+= adjkerntz.in devd.in dumpon.in ipfw.in mixer.in nscd.in \
powerd.in syscons.in
.SUFFIXES: .BSD.in
.BSD.in:
sed ${SED_REPLACE} ${SED_EXTRA} $< > $@

8
init.d/Makefile.Linux Normal file
View File

@@ -0,0 +1,8 @@
NET_LO= net.lo
SRCS+= hwclock.in consolefont.in keymaps.in modules.in mtab.in numlock.in \
procfs.in termencoding.in
.SUFFIXES: .Linux.in
.Linux.in:
sed ${SED_REPLACE} ${SED_EXTRA} $< > $@

12
init.d/Makefile.NetBSD Normal file
View File

@@ -0,0 +1,12 @@
NET_LO= net.lo0
# Generic BSD scripts
SRCS+= hostid.in moused.in newsyslog.in pf.in rarpd.in rc-enabled.in \
rpcbind.in savecore.in syslogd.in
# These are NetBSD specific
SRCS+= swap-blk.in ttys.in wscons.in
.SUFFIXES: .BSD.in
.BSD.in:
sed ${SED_REPLACE} ${SED_EXTRA} $< > $@

View File

@@ -16,6 +16,7 @@ fi
depend()
{
provide clock
# BSD adjkerntz needs to be able to write to /etc
if [ "${clock}" = "UTC" -a -e /etc/wall_cmos_clock ] ||
[ "${clock}" != "UTC" -a ! -e /etc/wall_cmos_clock ]; then
@@ -46,7 +47,7 @@ save()
stop()
{
# Don't tweak the hardware clock on LiveCD halt.
# Don't tweak the hardware clock on LiveCD halt.
if yesno "${clock_systohc:-${CLOCK_SYSTOHC}}"; then
[ -z "${CDBOOT}" ] && save
fi

View File

@@ -11,40 +11,45 @@ depend()
keyword noprefix
}
dir_writeable()
{
mkdir "$1"/.test.$$ 2>/dev/null && rmdir "$1"/.test.$$
}
cleanup_tmp_dir()
{
local dir=$1
local dir="$1"
mkdir -p "${dir}"
if ! [ -d "${dir}" ]; then
mkdir -p "${dir}" || return $?
fi
dir_writeable "${dir}" || return 1
chmod +t "${dir}"
cd "${dir}"
if yesno ${wipe_tmp:-${WIPE_TMP:-yes}}; then
ebegin "Wiping ${dir} directory"
local startopts="-x . -depth" delete="-exec rm -rf -- {} ;"
if [ "${RC_UNAME}" = "Linux" ]; then
startopts=". -xdev -depth"
# busybox find / rm cannot handle --
delete="-delete"
fi
local startopts="-x . -depth"
[ "${RC_UNAME}" = "Linux" ] && startopts=". -xdev -depth"
# Faster than find
rm -rf -- [b-ikm-pr-zA-Z0-9\.]*
find ${startopts} ! -name . \
! -path ./lost+found \
! -path "./lost+found" \
! -path "./lost+found/*" \
! -path ./quota.user \
! -path "./quota.user" \
! -path "./quota.user/*" \
! -path ./aquota.user \
! -path "./aquota.user" \
! -path "./aquota.user/*" \
! -path ./quota.group \
! -path "./quota.group" \
! -path "./quota.group/*" \
! -path ./aquota.group \
! -path "./aquota.group" \
! -path "./aquota.group/*" \
! -path ./journal \
! -path "./journal" \
! -path "./journal/*" \
${delete} \
-type d -prune
! -path "./.private" \
! -path "./.private/*" \
-exec rm -rf {} \;
eend 0
else
ebegin "Cleaning ${dir} directory"
@@ -58,12 +63,7 @@ cleanup_tmp_dir()
start()
{
if ! mkdir /.test.$$ 2>/dev/null; then
ewarn "Skipping /var and /tmp initialization (ro root?)"
return 0
fi
rmdir /.test.$$
local logw=false
# Ensure that our basic dirs exist
for x in /var/log /var/run /tmp; do
if ! [ -d "${x}" ]; then
@@ -74,57 +74,66 @@ start()
fi
done
ebegin "Creating user login records"
cp /dev/null /var/run/utmp
[ -e /var/log/wtmp ] || cp /dev/null /var/log/wtmp
chmod 0644 /var/run/utmp /var/log/wtmp
eend 0
if dir_writeable /var/run; then
ebegin "Creating user login records"
cp /dev/null /var/run/utmp
if dir_writeable /var/log; then
logw=true
[ -e /var/log/wtmp ] || cp /dev/null /var/log/wtmp
chmod 0644 /var/run/utmp /var/log/wtmp
fi
eend 0
ebegin "Cleaning /var/run"
for x in $(find /var/run ! -type d ! -name utmp ! -name random-seed \
! -name ld-elf.so.hints ! -name ld.so.hints);
do
[ ! -f "${x}" ] && continue
# Do not remove pidfiles of already running daemons
case "${x}" in
*.pid)
start-stop-daemon --test --quiet --stop \
--pidfile "${x}"
[ $? -eq 0 ] && continue
ebegin "Cleaning /var/run"
for x in $(find /var/run ! -type d ! -name utmp \
! -name random-seed \
! -name ld-elf.so.hints ! -name ld.so.hints);
do
[ ! -f "${x}" ] && continue
# Do not remove pidfiles of already running daemons
case "${x}" in
*.pid)
start-stop-daemon --test --quiet \
--stop --pidfile "${x}" && continue
;;
esac
rm -f -- "${x}"
done
eend 0
esac
rm -f -- "${x}"
done
eend 0
fi
# Clean up /tmp directories
local tmp=
for tmp in ${wipe_tmp_dirs-/tmp}; do
cleanup_tmp_dir "${tmp}"
done
chmod +t /tmp /var/tmp
# Make sure our X11 stuff have the correct permissions
# Omit the chown as bootmisc is run before network is up
# and users may be using lame LDAP auth #139411
rm -rf /tmp/.ICE-unix /tmp/.X11-unix
mkdir -p /tmp/.ICE-unix /tmp/.X11-unix
chmod 1777 /tmp/.ICE-unix /tmp/.X11-unix
[ -x /sbin/restorecon ] && restorecon /tmp/.ICE-unix /tmp/.X11-unix
if dir_writeable /tmp; then
# Make sure our X11 stuff have the correct permissions
# Omit the chown as bootmisc is run before network is up
# and users may be using lame LDAP auth #139411
rm -rf /tmp/.ICE-unix /tmp/.X11-unix
mkdir -p /tmp/.ICE-unix /tmp/.X11-unix
chmod 1777 /tmp/.ICE-unix /tmp/.X11-unix
[ -x /sbin/restorecon ] && restorecon /tmp/.ICE-unix /tmp/.X11-unix
fi
# Create an 'after-boot' dmesg log
if [ "${RC_SYS}" != "VSERVER" -a "${RC_SYS}" != "OPENVZ" ]; then
dmesg > /var/log/dmesg
chmod 640 /var/log/dmesg
if ${logw} || dir_writeable /var/log; then
# Create an 'after-boot' dmesg log
if [ "${RC_SYS}" != "VSERVER" -a "${RC_SYS}" != "OPENVZ" ]; then
dmesg > /var/log/dmesg
chmod 640 /var/log/dmesg
fi
fi
rm -f /etc/nologin
return 0
}
stop()
{
# Write a halt record if we're shutting down
case "${RC_SOFTLEVEL}" in
case "${RC_RUNLEVEL}" in
reboot|shutdown) [ "${RC_UNAME}" = "Linux" ] && halt -w;;
esac

View File

@@ -6,8 +6,7 @@ description="Sets a font for the consoles."
depend()
{
need localmount
need keymaps # sets up terminal encoding scheme
need localmount termencoding
after hotplug
keyword noopenvz noprefix nouml novserver noxenu
}
@@ -34,7 +33,7 @@ start()
return 0
fi
local x= param= sf_param= retval=0 ttydev=
local x= param= sf_param= retval=0 ttydev=/dev/tty
# Get additional parameters
if [ -n "${consoletranslation}" ]; then
@@ -45,11 +44,8 @@ start()
fi
# Set the console font
ebegin "Setting user font"
[ -d /dev/vc ] \
&& ttydev=/dev/vc/ \
|| ttydev=/dev/tty
ebegin "Setting console font [${consolefont}]"
[ -d /dev/vc ] && ttydev=/dev/vc/
x=1
while [ ${x} -le ${ttyn} ]; do
setfont ${consolefont} ${param} -C ${ttydev}${x} >/dev/null
@@ -61,17 +57,17 @@ start()
# Store the last font so we can use it ASAP on boot
if [ ${retval} -eq 0 -a -w "${RC_LIBDIR}" ]; then
mkdir -p "${RC_LIBDIR}"/console
for font in /usr/share/consolefonts/"${consolefont}".*; do
:
done
done
cp "${font}" "${RC_LIBDIR}"/console
echo "${font##*/}" > "${RC_LIBDIR}"/console/font
if yesno ${unicode:-${UNICODE}}; then
cp /dev/null "${RC_LIBDIR}"/console/unicode
echo "" > "${RC_LIBDIR}"/console/unicode
else
rm -f "${RC_LIBDIR}"/console/unicode
fi
fi
return ${retval}

View File

@@ -14,9 +14,9 @@ depend() {
}
start_pre() {
sysctl hw.bus.devctl_disable=0 >/dev/null
sysctl hw.bus.devctl_disable=0 >/dev/null
}
stop_post() {
sysctl hw.bus.devctl_disable=1 >/dev/null
sysctl hw.bus.devctl_disable=1 >/dev/null
}

View File

@@ -19,7 +19,7 @@ _abort() {
# We should only reboot when first booting
_reboot() {
if [ "${RC_SOFTLEVEL}" = "${RC_BOOTLEVEL}" ]; then
if [ "${RC_RUNLEVEL}" = "${RC_BOOTLEVEL}" ]; then
reboot "$@"
_abort || return 1
fi
@@ -27,9 +27,21 @@ _reboot() {
start()
{
local reboot_opts= fsck_opts= p=
local reboot_opts= fsck_opts= p= check_extra=
ebegin "Checking local filesystems"
if [ -e /fastboot ]; then
ewarn "Skipping fsck due to /fastboot"
return 0
fi
if [ -e /forcefsck ]; then
fsck_opts="${fsck_opts} -f"
check_extra="(check forced)"
fi
if [ -n "${fsck_passno}" ]; then
check_extra="[passno ${fsck_passno}] ${check_extra}"
fi
ebegin "Checking local filesystems ${check_extra}"
for p in ${fsck_passno}; do
local IFS="${_IFS}"
case "${p}" in
@@ -40,7 +52,7 @@ start()
done
if [ "${RC_UNAME}" = "Linux" ]; then
fsck_opts="-C0 -T"
fsck_opts="${fsck_opts} -C0 -T"
if [ -z "${fsck_passno}" ]; then
fsck_args=${fsck_args--A -p}
if echo 2>/dev/null >/.test.$$; then

View File

@@ -28,6 +28,7 @@ sync; sync
# 1) we don't need (and by default can't) umount anything (VServer) or
# 2) the host utils take care of all umounting stuff (OpenVZ)
if [ "${RC_SYS}" = "VSERVER" -o "${RC_SYS}" = "OPENVZ" ]; then
[ "${RC_SYS}" = "OPENVZ" -a "$1" = "reboot" ] && echo "" > /reboot
if [ -e @SYSCONFDIR@/init.d/"$1".sh ]; then
. @SYSCONFDIR@/init.d/"$1".sh
else

View File

@@ -23,6 +23,7 @@ fi
depend()
{
provide clock
if yesno ${clock_adjfile}; then
use root
else

View File

@@ -87,7 +87,7 @@ start() {
# Only IPs and nets in firewall_allowservices is allowed in.
for i in ${ipfw_ip_in}; do
for p in ${ipfw_ports_in}; do
ipfw add pass tcp from ${i} to me ${p}
ipfw add pass tcp from ${i} to me ${p}
done
done

View File

@@ -8,13 +8,13 @@ ttyn=${rc_tty_number:-${RC_TTY_NUMBER:-12}}
unicode=${unicode:-${UNICODE}}
keymap=${keymap:-${KEYMAP}}
extended_keymaps=${extended_keymaps:-${EXTENDED_KEYMAPS}}
windowskeys=${windowskeys:-${SET_WINDOWSKEYS}}
windowkeys=${windowkeys:-${SET_WINDOWSKEYS}}
fix_euro=${fix_euro:-${FIX_EURO}}
dumpkeys_charset=${dumpkeys_charset:-${DUMPKEYS_CHARSET}}
depend()
{
need localmount
need localmount termencoding
keyword noopenvz noprefix nouml novserver noxenu
}
@@ -25,43 +25,41 @@ start()
return 1
fi
local ttydev= n=
[ -d /dev/vc ] \
&& ttydev=/dev/vc/ \
|| ttydev=/dev/tty
local ttydev=/dev/tty n=
[ -d /dev/vc ] && ttydev=/dev/vc/
# Force linux keycodes for PPC.
if [ -f /proc/sys/dev/mac_hid/keyboard_sends_linux_keycodes ]; then
echo 1 > /proc/sys/dev/mac_hid/keyboard_sends_linux_keycodes
fi
ebegin "Loading key mappings"
local loadkeys_uni= wkeys=
yesno ${unicode} && loadkeys_uni="--unicode"
yesno ${windowskeys} && wkeys="windowkeys"
ebegin "Loading key mappings [${keymap}]"
local loadkeys_uni= wkeys= kmode="-a" msg="ASCII"
if yesno ${unicode}; then
loadkeys_uni="--unicode"
kmode="-u"
msg="UTF-8"
fi
yesno ${windowkeys} && wkeys="windowkeys"
loadkeys -q ${loadkeys_uni} ${wkeys} ${keymap} ${extended_keymaps}
eend $? "Error loading key mappings" || return $?
if yesno ${fix_euro}; then
ebegin "Fixing font for euro symbol"
# Fix some fonts displaying the Euro, #173528.
echo "altgr keycode 18 = U+20AC" | loadkeys -q
eend $?
fi
# Set terminal encoding to either ASCII or UNICODE.
# See utf-8(7) for more information.
local termencoding="%@" termmsg="ASCII" kmode="-a"
ebegin "Setting keyboard mode [${msg}]"
if yesno ${unicode}; then
dumpkeys ${dumpkeys_charset:+-c} \
${dumpkeys_charset} | loadkeys --unicode
termencoding="%G"
termmsg="UTF-8"
kmode="-u"
fi
ebegin "Setting terminal encoding to" ${termmsg}
n=1
while [ ${n} -le "${ttyn}" ]; do
printf "\033%s" "${termencoding}" >"${ttydev}${n}"
kbd_mode "${kmode}" -C "${ttydev}${n}"
n=$((${n} + 1))
done

View File

@@ -23,7 +23,7 @@ start()
x=${KV#*.*.}
local KV_MICRO=${x%%-*}
local list= x= args= cnt=0
local list= x= xx= y= args= cnt=0
for x in "${KV}" \
${KV_MAJOR}.${KV_MINOR}.${KV_MICRO} \
${KV_MAJOR}.${KV_MINOR} \
@@ -35,7 +35,15 @@ start()
for x in ${list}; do
ebegin "Loading module ${x}"
eval args=\$module_$(shell_var "${x}")_args
xx=$(shell_var "${x}")
for y in "${KV}" \
${KV_MAJOR}.${KV_MINOR}.${KV_MICRO} \
${KV_MAJOR}.${KV_MINOR} \
; do
eval args=\$module_${xx}_args_$(shell_var "${y}")
[ -n "${args}" ] && break
done
[ -z "${args}" ] && eval args=\$module_${xx}_args
eval modprobe -q "${x}" "${args}"
eend $? "Failed to load ${x}" && cnt=$((${cnt} + 1))
done

View File

@@ -2,7 +2,7 @@
# Copyright 2007-2008 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.
mouse=${SVCNAME##*.}
mouse=${RC_SVCNAME##*.}
if [ -n "${name}" -a "${mouse}" != "moused" ]; then
moused_device=/dev/"${mouse}"
pidfile=/var/run/moused-"${mouse}".pid

View File

@@ -15,7 +15,7 @@ __IFS="
"
depend()
{
local IFACE=${SVCNAME#*.}
local IFACE=${RC_SVCNAME#*.}
local IFVAR=$(shell_var "${IFACE}")
need localmount
@@ -28,7 +28,7 @@ depend()
*) after net.lo net.lo0;;
esac
if type depend_${IFVAR} >/dev/null 2>&1; then
if [ "$(command -v "depend_${IFVAR}")" = "depend_${IFVAR}" ]; then
depend_${IFVAR}
fi
@@ -335,7 +335,7 @@ _load_modules()
# Now load and wrap our functions
if ! . "${MODULESDIR}/${mod}.sh"; then
eend 1 "${SVCNAME}: error loading module \`${mod}'"
eend 1 "${RC_SVCNAME}: error loading module \`${mod}'"
exit 1
fi
@@ -344,7 +344,7 @@ _load_modules()
# Wrap our provides
local f=
for f in pre_start start post_start; do
eval "${provides}_${f}() { type ${mod}_${f} >/dev/null 2>&1 || return 0; ${mod}_${f} \"\$@\"; }"
eval "${provides}_${f}() { [ "$(command -v "${mod}_${f}")" = "${mod}_${f}" ] || return 0; ${mod}_${f} \"\$@\"; }"
done
eval module_${mod}_provides="${provides}"
@@ -358,7 +358,7 @@ _load_modules()
eval x=\$module_${mod}_provides
[ -z "${x}" ] && continue
for f in pre_start start post_start; do
eval "${x}_${f}() { type ${mod}_${f} >/dev/null 2>&1 || return 0; ${mod}_${f} \"\$@\"; }"
eval "${x}_${f}() { [ "$(command -v "${mod}_${f}")" = "${mod}_${f}" ] || return 0; ${mod}_${f} \"\$@\"; }"
done
eval module_${x}_providedby="${mod}"
;;
@@ -447,7 +447,7 @@ _load_config()
start()
{
local IFACE=${SVCNAME#*.} oneworked=false module=
local IFACE=${RC_SVCNAME#*.} oneworked=false module=
local IFVAR=$(shell_var "${IFACE}") cmd= our_metric=
local metric=0
@@ -462,7 +462,7 @@ start()
# We up the iface twice if we have a preup to ensure it's up if
# available in preup and afterwards incase the user inadvertently
# brings it down
if type preup >/dev/null 2>&1; then
if [ "$(command -v preup)" = "preup" ]; then
_up 2>/dev/null
ebegin "Running preup"
eindent
@@ -473,7 +473,7 @@ start()
_up 2>/dev/null
for module in ${MODULES}; do
if type "${module}_pre_start" >/dev/null 2>&1; then
if [ "$(command -v "${module}_pre_start")" = "${module}_pre_start" ]; then
${module}_pre_start || exit $?
fi
done
@@ -487,7 +487,7 @@ start()
if ! _wait_for_carrier; then
if service_started devd; then
ewarn "no carrier, but devd will start us when we have one"
mark_service_inactive "${SVCNAME}"
mark_service_inactive "${RC_SVCNAME}"
else
eerror "no carrier"
fi
@@ -522,7 +522,7 @@ start()
null) :;;
[0-9]*|*:*) _add_address ${config};;
*)
if type "${config}_start" >/dev/null 2>&1; then
if [ "$(command -v "${config}_start")" = "${config}_start" ]; then
"${config}"_start
else
eerror "nothing provides \`${config}'"
@@ -547,7 +547,7 @@ start()
done
if ! ${oneworked}; then
if type failup >/dev/null 2>&1; then
if [ "$(command -v failup)" = "failup" ]; then
ebegin "Running failup"
eindent
failup
@@ -600,12 +600,12 @@ ${routes}"
fi
for module in ${MODULES}; do
if type "${module}_post_start" >/dev/null 2>&1; then
if [ "$(command -v "${module}_post_start")" = "${module}_post_start" ]; then
${module}_post_start || exit $?
fi
done
if type postup >/dev/null 2>&1; then
if [ "$(command -v postup)" = "postup" ]; then
ebegin "Running postup"
eindent
postup
@@ -617,7 +617,7 @@ ${routes}"
stop()
{
local IFACE=${SVCNAME#*.} module=
local IFACE=${RC_SVCNAME#*.} module=
local IFVAR=$(shell_var "${IFACE}") opts=
einfo "Bringing down interface ${IFACE}"
@@ -628,7 +628,7 @@ stop()
_load_modules false
fi
if type predown >/dev/null 2>&1; then
if [ "$(command -v predown)" = "predown" ]; then
ebegin "Running predown"
eindent
predown || return 1
@@ -641,35 +641,40 @@ stop()
fi
for module in ${MODULES}; do
if type "${module}_pre_stop" >/dev/null 2>&1; then
if [ "$(command -v "${module}_pre_stop")" = "${module}_pre_stop" ]; then
${module}_pre_stop || exit $?
fi
done
for module in ${MODULES}; do
if type "${module}_stop" >/dev/null 2>&1; then
if [ "$(command -v "${module}_stop")" = "${module}_stop" ]; then
${module}_stop
fi
done
# Only delete addresses for non PPP interfaces
if ! type is_ppp >/dev/null 2>&1 || ! is_ppp; then
if ! [ "$(command -v is_ppp)" = "is_ppp" ] || ! is_ppp; then
_delete_addresses "${IFACE}"
fi
for module in ${MODULES}; do
if type "${module}_post_stop" >/dev/null 2>&1; then
if [ "$(command -v "${module}_post_stop")" = "${module}_post_stop" ]; then
${module}_post_stop
fi
done
! yesno ${IN_BACKGROUND} && \
[ "${IFACE}" != "lo" -a "${IFACE}" != "lo0" ] && \
_down 2>/dev/null
# If not in background, and not loopback then bring the interface down
# unless overridden.
if ! yesno ${IN_BACKGROUND} && \
[ "${IFACE}" != "lo" -a "${IFACE}" != "lo0" ]; then
eval module=\$ifdown_${IFVAR}
module=${module:-YES}
yesno ${module} && _down 2>/dev/null
fi
type resolvconf >/dev/null 2>&1 && resolvconf -d "${IFACE}" 2>/dev/null
if type postdown >/dev/null 2>&1; then
if [ "$(command -v "postdown")" = "postdown" ]; then
ebegin "Running postdown"
eindent
postdown

View File

@@ -23,17 +23,18 @@ depend()
{
# Only have portmap as a dependency if there is a nfs mount in fstab
# that is set to mount at boot
local pmap=""
local pmap=
if need_portmap; then
pmap="${pmap} rpc.statd"
pmap="rpc.statd"
[ -x @SYSCONFDIR@/init.d/rpcbind ] \
&& pmap="rpcbind" \
|| pmap="portmap"
&& pmap="${pmap} rpcbind" \
|| pmap="${pmap} portmap"
fi
config /etc/fstab
need net ${pmap}
use afc-client amd autofs dns nfs nfsmount portmap rpcbind rpc.statd
use afc-client amd autofs openvpn
use dns nfs nfsmount portmap rpcbind rpc.statd
keyword nojail noopenvz noprefix novserver
}
@@ -46,14 +47,14 @@ start()
for x in ${net_fs_list}; do
case "${x}" in
nfs|nfs4)
# If the nfsmount script took care of the nfs
# If the nfsmount script took care of the nfs
# filesystems, then there's no point in trying
# them twice
service_started nfsmount && continue
# Only try to mount NFS filesystems if portmap was
# Only try to mount NFS filesystems if portmap was
# started. This is to fix "hang" problems for new
# users who do not add portmap to the default runlevel.
# users who do not add portmap to the default runlevel.
if need_portmap && ! service_started "${pmap}"; then
continue
fi

View File

@@ -26,7 +26,7 @@ start()
local usbfs=$(grep -Fow usbfs /proc/filesystems ||
grep -Fow usbdevfs /proc/filesystems)
if [ -n "${usbfs}" ]; then
ebegin "Mounting USB device filesystem (${usbfs})"
ebegin "Mounting USB device filesystem [${usbfs}]"
local usbgid="$(getent group usb | \
sed -e 's/.*:.*:\(.*\):.*/\1/')"
mount -t ${usbfs} \

View File

@@ -24,9 +24,7 @@ start()
done
# If we have an init script for this service, continue
[ -x @SYSCONFDIR@/init.d/"${service}" ] && continue
[ -x @PKG_PREFIX@/@SYSCONFDIR@/init.d/"${service}" ] && continue
[ -x @LOCAL_PREFIX@/@SYSCONFDIR@/init.d/"${service}" ] && continue
rc-service --exists "${service}" && continue
# Ensure that the users rc.conf will start us - ignore the defaults
eval enabled=\$${svc##*/}_enable

View File

@@ -13,7 +13,7 @@ depend()
start()
{
if echo 2>/dev/null >/.test.$$; then
rm -f /.test.$$
rm -f /.test.$$ /fastboot /forcefsck
return 0
fi
@@ -22,5 +22,7 @@ start()
Linux) mount -n -o remount,rw /;;
*) mount -u -o rw /;;
esac
eend $? "Root filesystem could not be mounted read/write"
if eend $? "Root filesystem could not be mounted read/write"; then
rm -f /fastboot /forcefsck
fi
}

View File

@@ -49,10 +49,10 @@ start() {
local v= f=
for v in font8x16 font8x14 font8x8; do
f=$(eval \$"${v}")
eval f=\$${v}
if [ -n "${f}" ]; then
ebegin "Setting font ${f}"
vidcontrol -f ${v##FONT} ${f}
vidcontrol -f ${v##font} ${f}
eend $?
fi
done

View File

@@ -12,9 +12,8 @@ depend()
start()
{
[ -e /etc/sysctl.conf ] || return 0
ebegin "Configuring kernel parameters"
local retval=0 var= comments=
ebegin "Configuring kernel parameters"
while read var comments; do
case "${var}" in
""|"#"*) continue;;
@@ -22,5 +21,4 @@ start()
sysctl -w "${var}" >/dev/null || retval=1
done < /etc/sysctl.conf
eend ${retval} "Some errors were encountered"
eend $?
}

View File

@@ -13,6 +13,6 @@ start()
{
[ -e /etc/sysctl.conf ] || return 0
ebegin "Configuring kernel parameters"
sysctl -p /etc/sysctl.conf >/dev/null
eend $?
sysctl -p >/dev/null
eend $? "Some errors were encountered"
}

35
init.d/termencoding.in Normal file
View File

@@ -0,0 +1,35 @@
#!@PREFIX@/sbin/runscript
# Copyright 2008 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.
description="Configures terminal encoding."
ttyn=${rc_tty_number:-${RC_TTY_NUMBER:-12}}
unicode=${unicode:-${UNICODE}}
depend()
{
keyword noopenvz noprefix nouml novserver noxenu
}
start()
{
local ttydev=/dev/tty n=
[ -d /dev/vc ] && ttydev=/dev/vc/
# Set terminal encoding to either ASCII or UNICODE.
# See utf-8(7) for more information.
local termencoding="%@" termmsg="ASCII"
if yesno ${unicode}; then
termencoding="%G"
termmsg="UTF-8"
fi
ebegin "Setting terminal encoding [${termmsg}]"
n=1
while [ ${n} -le "${ttyn}" ]; do
printf "\033%s" "${termencoding}" >"${ttydev}${n}"
n=$((${n} + 1))
done
eend 0
}

View File

@@ -61,15 +61,15 @@ start()
mapfile)
local entry=
while read entry; do
case "${entry}" in
case "${entry}" in
\#*|"")
continue
;;
continue
;;
*)
cmd="${wsctl} -w \"map+=${entry}\""
eval "${cmd} >/dev/null"
;;
esac
cmd="${wsctl} -w \"map+=${entry}\""
eval "${cmd} >/dev/null"
;;
esac
done < "${arg1}"
;;

View File

@@ -1,7 +1,8 @@
MAN3= einfo.3 \
rc_config.3 rc_deptree.3 rc_find_pids.3 rc_plugin_hook.3 \
rc_runlevel.3 rc_service.3 rc_strcatpaths.3 rc_strlist.3
MAN8= rc-status.8 rc-update.8 rc.8 runscript.8 start-stop-daemon.8
rc_runlevel.3 rc_service.3 rc_stringlist.3
MAN8= rc-service.8 rc-status.8 rc-update.8 rc.8 runscript.8 \
start-stop-daemon.8
# Handy macro to create symlinks
# This does rely on correctly formatting our manpages!
@@ -11,7 +12,7 @@ MAKE_LINKS= suffix=$${man\#*.}; \
-n -e '/^\.Sh NAME$$/,/\.Sh/ s/\.Nm //p' $${man}`; do \
if test "$${link}" != "$${prefix}" ; then \
ln -sf $${man} \
${DESTDIR}/${MANDIR}$${suffix}/$${link}.$${suffix} ; \
${DESTDIR}/${MANDIR}/man$${suffix}/$${link}.$${suffix} ; \
fi; \
done;
@@ -22,15 +23,17 @@ include ${MK}/gitignore.mk
all:
install:
${INSTALL} -d ${DESTDIR}/${MANDIR}3
${INSTALL} -d ${DESTDIR}/${MANDIR}/man3
for man in ${MAN3}; do \
${INSTALL} -m ${MANMODE} "$$man" ${DESTDIR}/${MANDIR}3 || exit $$?; \
${INSTALL} -m ${MANMODE} "$$man" ${DESTDIR}/${MANDIR}/man3 || exit $$?; \
${MAKE_LINKS} \
done
${INSTALL} -d ${DESTDIR}/${MANDIR}8
${INSTALL} -d ${DESTDIR}/${MANDIR}/man8
for man in ${MAN8}; do \
${INSTALL} -m ${MANMODE} "$$man" ${DESTDIR}/${MANDIR}8 || exit $$?; \
${INSTALL} -m ${MANMODE} "$$man" ${DESTDIR}/${MANDIR}/man8 || exit $$?; \
${MAKE_LINKS} \
done
check test::
clean:

View File

@@ -22,7 +22,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.Dd Feb 22, 2008
.Dd Mar 16, 2008
.Dt EINFO 3 SMM
.Os OpenRC
.Sh NAME
@@ -62,7 +62,7 @@ Enhanced Informatation output library (libeinfo, -leinfo)
.Ft int Fn ewend "int retval" "const char * restrict format" ...
.Ft int Fn eendv "int retval" "const char * restrict format" ...
.Ft int Fn ewendv "int retval" "const char * restrict format" ...
.Ft void Fn ebracket "int col" "einfo_color_t color" "const char * restrict msg"
.Ft void Fn ebracket "int col" "ECOLOR color" "const char * restrict msg"
.Ft void Fn eindent void
.Ft void Fn eoutdent void
.Ft void Fn eindentv void

Some files were not shown because too many files have changed in this diff Show More