Compare commits

..

141 Commits

Author SHA1 Message Date
Johan Bergström
5bdd08e0e7 Pass ncurses cflags to build
Fixes #25
Note from William Hubbs:
The original patch overwrote CFLAGS. I modified this patch to add the
ncurses cflags to CPPFLAGS instead of overwriting CFLAGS.
2014-10-26 13:32:46 -05:00
William Hubbs
8a68dc899e Fix compile errors created by bundling queue.h 2014-10-24 10:59:16 -05:00
Anthony G. Basile
2d1e255285 helpers.h, start-stop-daemon.c: remove uneeded macros
TAILQ_CONCAT, TAILQ_FOREACH_SAFE and LIST_FOREACH_SAFE are defined
in our bundled queue.h and are no longer required.
2014-10-24 10:59:16 -05:00
Anthony G. Basile
6f9fd30edb 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-24 10:59:16 -05:00
William Hubbs
e0c32c23dc Fix all tests for GNU/kFreeBSD
It is necessary to check for both the kernel and c library because
__FreeBSD_kernel is also defined on native FreeBSD [1].

[1] http://sourceforge.net/p/predef/wiki/OperatingSystems/
2014-10-24 10:59:16 -05:00
Gabriele Giacone
4777035d53 Fix rc_svcdir for GNU/Hurd 2014-10-24 10:59:16 -05:00
Svante Signell
f049b535b3 fix defines for GNU/Hurd 2014-10-24 10:59:16 -05:00
Svante Signell
4ba30c5a1b add missing files for GNU/Hurd 2014-10-24 10:59:15 -05:00
Gabriele Giacone
91734d20be Fix rc_svcdir for GNU/kFreeBSD 2014-10-24 10:59:15 -05:00
Gabriele Giacone
b4194fef43 Add missing files for GNU/kFreeBSD 2014-10-24 10:59:15 -05:00
Svante Signell
5f23128f30 Fix GNU/kFreeBSD port
Check for __FreeBSD_kernel instead of __GLIBC__ in source files.

note from William Hubbs:
I was told this is a better check for GNU/kFreeBSD than checking the
C  library the source is being compiled against.
GNU/kFreeBSD than checking which library we are using.
2014-10-24 10:59:15 -05:00
Anthony G. Basile
a634534167 einfo.h, rc.h.in: simplify __BEGIN_DECLS logic
There is no need to redefine __BEGIN_DECLS and __END_DECLS.
We simplify the logic here and avoid undefining these macros.
2014-10-24 10:59:15 -05:00
Anthony G. Basile
f77006b58e einfo.h, rc.h.in: ensure __BEGIN_DECLS is defined
Some Standard C Libraries, like musl, don't define __BEGIN_DECLS
or __END_DECLS.  We add some ifdef magic to ensure these are
available.
2014-10-24 10:59:15 -05:00
William Hubbs
ef22f78a48 Update news file wrt chroot variable 2014-10-20 16:03:27 -05:00
Alexander Vershilov
735dc45c39 librc:look for the pid file in a chroot if defined
X-Gentoo-Bug: 524388
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=524388
2014-10-20 16:03:27 -05:00
William Hubbs
0d3fdd3769 runscript.sh: add chroot support
This adds support for a chroot variable which will be passed to the
start-stop-daemon --chroot switch to runscript.sh when starting a
daemon. This also needs to be saved so it can be used in locating the
pid file when stopping the daemon.

X-Gentoo-Bug: 524388
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=524388
2014-10-20 16:03:27 -05:00
William Hubbs
5a1a94b2cc Add NEWS file 2014-10-20 16:03:27 -05:00
William Hubbs
a76e5a827c add back nfs and nfs4 file systems
Fix gentoo bug #427996 correctly.
We should attempt to mount the file systems, but not try to start the
daemons. The previous fix removed mounting the file systems as well as
starting the daemons.

X-Gentoo-Bug: 508574
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=508574
2014-10-20 16:03:27 -05:00
William Hubbs
b964de8287 man: Document start_inactive and in_background_fake 2014-10-16 11:42:38 -05:00
William Hubbs
2c1051ad3f typo fix 2014-10-16 11:32:48 -05:00
Roy Marples
a2187e897e Use exception-based approach for cgroup/ulimit setup
Note from William Hubbs:
I spoke with Roy about this, and he pointed out that user-defined
functions may need the limits applied, so it is better to go with a
method that uses exceptions to determine which functions apply the
limits.

X-Gentoo-Bug: 522408
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=522408
2014-10-16 11:09:36 -05:00
Rick Farina (ZeroChaos)
e8043fe378 localmount: unmount aufs branches 2014-10-13 15:41:03 -05:00
William Hubbs
082fd53d9e runscript: move verbose mode setting near debug setting 2014-10-13 15:40:54 -05:00
Joe M
61fd8b2996 savecache: check permissions on the correct directory 2014-10-13 15:39:56 -05:00
Andrew Gregory
43d727dc3f tmpfiles.sh: add support for C action
Recursively copies files or directories.  Added by systemd in 849958d1.
2014-10-13 15:39:36 -05:00
Andrew Gregory
b8e52583ca tmpfiles.sh: add support for + modifier
systemd added support for b+, c+, p+, and L+ in 2e78fa79 and 1554afae to
remove the target path if it already exists.
2014-10-13 15:39:22 -05:00
William Hubbs
1a7af5bbde Start work on 0.13.2 2014-10-13 15:39:12 -05:00
William Hubbs
785b61e872 cgroups: fix cgroup subsystem mounting
Originally, we aborted all of the cgroup setup if /sys/fs/cgroup/openrc
was already mounted. This  caused an issue in lxc containers, so we
should always allow the subsystems to be mounted.

X-Gentoo-Bug: 520606
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=520606
2014-08-22 14:19:03 -05:00
William Hubbs
54ed42503f start work on 0.13.1 2014-08-22 14:18:33 -05:00
William Hubbs
c60ef5c381 mtab: add verbose level deprecation warnings 2014-08-17 11:23:52 -05:00
William Hubbs
bee3f8463c README: Clarify devfs changes
I was informed that the previous explanation of the devfs changes could
be interpreted to mean that we mount a second /dev on top of the one
that was mounted by the kernel or initramfs. This change makes it clear
that is not the case.
2014-08-17 00:11:14 -05:00
William Hubbs
72b7b32502 README: add notes about devfs changes 2014-08-16 17:16:20 -05:00
William Hubbs
645f7b6947 adjust deprecation schedule for mtab
- Quiet the deprecation messages forr now
- update the feature removal schedule to reflect that it will be removed
  in 2.0.
2014-08-16 15:07:48 -05:00
William Hubbs
1b26d547a5 Deprecate the mtab service script
The mtab service script is no longer needed on modern Linux systems, so
we can remove it in 1.0. However, we need to set a deprecation notice
first.
2014-08-14 13:50:48 -05:00
William Hubbs
c8018d04a7 tmpfiles: fix relabel to run restorecon before chown and chmod 2014-08-13 15:26:37 -05:00
Jason Zaman
6f080e9c1a tmpfiles: Move relabelling before any other calls for device nodes
Device nodes are normally never device_t so this type does not
have many permissions. After the mknod, the device should have
its label corrected before any other operations (like chmod).
2014-08-13 10:02:20 -05:00
William Hubbs
2c265e13c6 README: expand information about rc and runscript deprecation 2014-08-11 13:17:33 -05:00
William Hubbs
24d82d9ff1 rc.conf: document rc_verbose 2014-08-11 12:57:23 -05:00
William Hubbs
d1e71b07af Show rc and runscript deprecation warnings in verbose mode
These messages are being changed for this release to show in verbose
mode because of the number of times they display.
2014-08-11 12:32:44 -05:00
William Hubbs
7b744befac bootmisc: do not run the clean_run function in an LXC container 2014-08-10 17:15:05 -05:00
William Hubbs
faaaab4bf5 hwclock: fix comments about the usage of clock_hctosys
The clock_hctosys variable should be set to YES if you are not using NTP to
synchronize your system time; it doesn't have anything to do with the
kernel configuration.
2014-08-10 13:00:39 -05:00
William Hubbs
d29db70efb sysctl.linux.in: use the --system option
According to the sysctl man page, the --system option causes sysctl to
process all system configuration files, which include the following:

/run/sysctl.d/*.conf
/etc/sysctl.d/*.conf
/usr/local/lib/sysctl.d/*.conf
/usr/lib/sysctl.d/*.conf
/lib/sysctl.d/*.conf
/etc/sysctl.conf

X-Gentoo-Bug: 484796
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=484796
2014-08-09 12:35:04 -05:00
William Hubbs
6a337ff6c5 devfs: several small clarifications
- Rename the static_dev switch in conf.d/devfs to skip_mount_dev since
  this is a better description of what the switch does.

- Clarify the error messages in the devfs service script based on the
  new name of the switch.
2014-08-08 14:49:00 -05:00
Jason Zaman
647e08eb91 tmpfiles.sh: do not use install
install is in /usr which causes problems if /usr is not mounted.
Instead, checkpath and "mkdir -p" can do everything required and are
both available before /usr is mounted.
Since checkpath also handles selinux labels correctly,
_restorecon after is not required.

X-Gentoo-Bug: 503408
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=503408
2014-08-07 12:54:04 -05:00
William Hubbs
2624a8c8a7 checkpath: apply ownership to all paths given on command line
The stat structure was not being initialized correctly in do_check. This
was causing the owner adjustment to be skipped if the first path had the
correct owner.

Also, the "correcting owner" message should always be printed when the
owner is being changed.

X-Gentoo-Bug: 518042
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=518042
2014-07-28 10:41:24 -05:00
William Hubbs
275714bdc7 checkpath: style fix 2014-07-25 11:04:57 -05:00
William Hubbs
e3bfb68aec hwclock: always set the kernel's timezone
The hwclock service should set the time zone regardless of the setting
of the clock_hctosys variable. This needs to be done to prevent issues
when the system time is being synchronized using ntp.

X-Gentoo-Bug: 434410
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=434410
2014-07-24 17:40:14 -05:00
William Hubbs
1f7582c78b src/librc/librc-daemon.c: style fix 2014-07-19 13:03:00 -05:00
William Hubbs
cc1bc6a4ce src/rc/Makefile: typo fix 2014-07-19 12:59:35 -05:00
William Hubbs
40f42ced21 rc-status: fix infinite loop when using stacked runlevels
Remove the recursive call in print_stacked_services which was causing an
infinite loop when using stacked runlevels.
I would like to thank Doug Freed and Jason Zaman for assisting with
tracking this down.

X-Gentoo-Bug: 514972
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=514972
2014-07-17 23:10:28 -05:00
Jason Zaman
1a1d53335b devfs: fix restorecon ebegin message to match sys
X-Gentoo-Bug: 516956
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=516956
2014-07-16 18:22:33 -05:00
Jason Zaman
99939b9839 sysfs: restorecon after mounting /sys
X-Gentoo-Bug: 516956
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=516956
2014-07-16 18:21:59 -05:00
Jason Zaman
89907b60ba move the selinux_setup function into rc-selinux
X-Gentoo-Bug: 516956
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=516956
2014-07-16 17:59:25 -05:00
William Hubbs
a94a9740d5 checkpath: style fixes 2014-07-16 15:03:11 -05:00
William Hubbs
8b8edc2970 style fixes 2014-07-16 14:48:03 -05:00
William Hubbs
010c2ab18b Rename SELinux source files
The name rc-selinux-util.* is a bit long, so I renamed the source files
to rc-selinux.*

X-Gentoo-Bug: 516956
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=516956
2014-07-16 14:14:37 -05:00
Jason Zaman
9c689542c3 checkpath: restore the SELinux context
X-Gentoo-Bug: 516956
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=516956
2014-07-16 13:09:38 -05:00
Jason Zaman
525d7140b1 devfs: fix SELinux contexts
SELinux contexts in /dev need to be fixed after it is mounted

X-Gentoo-Bug: 516956
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=516956
2014-07-16 11:58:11 -05:00
Jason Zaman
4f784bd469 tmpfiles: set the proper SELinux context
Restore the label on the created file / dir based on the policy
fcontexts.

X-Gentoo-Bug: 516956
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=516956
2014-07-16 10:53:25 -05:00
William Hubbs
4a1afa694c Add SELinux support to the build system
X-Gentoo-Bug: 516956
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=516956
2014-07-15 11:38:19 -05:00
William Hubbs
25c229cf83 sysfs.in: fix indentation 2014-07-14 15:58:50 -05:00
William Hubbs
71d6d61b28 checkpath: fix logic for the writable option
The -W option does not need an argument of its own; it can take the
first path after all other options are processed on the command line.

Also, move the processing for the -W option out of the switch so it will
be in the same loop as the other processing.
2014-07-13 14:12:36 -05:00
William Hubbs
40141244e3 man/openrc-run.8: more updates and clarifications for checkpath
X-Gentoo-Bug: 500606
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=500606
2014-07-13 11:23:43 -05:00
Alexander V Vershilov
d59737afb1 man/openrc.8: update checkpath documentation
X-GENTOO-BUG: 500606
X-GENTOO-BUG-URL: https://bugs.gentoo.org/show_bug.cgi?id=500606
2014-07-13 08:50:36 -05:00
Alexander V Vershilov
f66f41c4f0 typo fix 2014-07-11 16:36:35 -05:00
William Hubbs
d80482c2f4 checkpath: fix error message in previous commit 2014-07-11 15:23:38 -05:00
William Hubbs
d0040aff0a checkpath: report an error if required options were not specified
Before this commit, not specifying -d, -f, -p or -W in a checkpath
command meant the command exited successfully but actually did nothing.

This is an error condition, so report it as such.
2014-07-11 15:04:06 -05:00
William Hubbs
75e06d8558 Style Fixes 2014-07-10 10:57:56 -05:00
Alexander V Vershilov
1a44be0f16 cgroups: only run cgroup setup when starting a service
Status call should not set limits as it requires root permissions,
also this is not safe, as current process may reach limitation.

Solution is to set limits and move process to service cgroup only
on start.

X-GENTOO-BUG: 500364
X-GENTOO-BUG-URL: https://bugs.gentoo.org/show_bug.cgi?id=500364
2014-07-10 10:56:37 -05:00
William Hubbs
f265ddde97 FEATURE_REMOVAL_SCHEDULE: add entry for local_start/stop 2014-07-10 09:04:04 -05:00
William Hubbs
57b9e601a9 init.d/local: bring functioning more in line with how sysctl works
- remove the has_executables variable since it isn't used.
- Convert the conditional calls to ewend/vewend to a single call to veend.
- Always call eend after all scripts are executed passing the appropriate
error code.

Because of this change, you will see only an overall status when
starting or stopping local unless you are using verbose mode.
2014-07-09 15:33:48 -05:00
Thomas D
c1de8c09bf Add support for verbose "local" service runscript
With this patch, the "local" service runscript will be verbose like the
"sysctl" service when 'rc_verbose="yes"' is set.

Example output successful start:

 * Stopping local ...
 *   Executing "/etc/local.d/00will-stop.stop" ...                  [ ok ]
 * Starting local ...
 *   Executing "/etc/local.d/00will-start.start" ...                [ ok ]
 *   Executing "/etc/local.d/01 test.start" ...                     [ ok ]

Example output with failing executables:

 * Stopping local ...
 *   Executing "/etc/local.d/00will-stop.stop" ...                  [ ok ]
 *   Executing "/etc/local.d/will-fail.stop" ...
mount: can't find foo in /etc/fstab
 *   Execution of "/etc/local.d/will-fail.stop" failed.             [ !! ]
 * Starting local ...
 *   Executing "/etc/local.d/00will-start.start" ...                [ ok ]
 *   Executing "/etc/local.d/01 test.start" ...                     [ ok ]
 *   Executing "/etc/local.d/will-fail2.start" ...
mount: can't find bar in /etc/fstab
 *   Execution of "/etc/local.d/will-fail2.start" failed.           [ !! ]
 *   Executing "/etc/local.d/will-fail.start" ...
mount: can't find foo in /etc/fstab
 *   Execution of "/etc/local.d/will-fail.start" failed.            [ !! ]

X-Gentoo-Bug: 489274
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=489274
2014-07-05 13:12:30 -05:00
Kaarle Ritvanen
143f1c64c1 sysctl.Linux.in: remove -lxc from keywords
certain tunables can be set independently for each container

X-Gentoo-Bug: 516050
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=516050
2014-07-04 08:33:55 -05:00
William Hubbs
b4b34d909c Schedule removal of the opts variable from service scripts 2014-07-01 07:15:22 -05:00
William Hubbs
56112a6f1f sysfs: Do not mount openrc cgroup if it is already mounted
We were not checking to see if /sys/fs/cgroup/openrc was already mounted
before we mounted it. This fixes that issue.
Thanks to Robin Johnson <robbat2@gentoo.org> for pointing this out.
2014-06-30 20:30:39 -05:00
William Hubbs
09d81e86f2 Make history a separate document
Move the additional history information from Daniel Robbins' wiki
page along with the history from README to a separate file,
README.history.

X-Gentoo-Bug: 513024
X-Gentoo-Bug-URL: https://bugs.gentoo.org/513024
2014-06-23 20:41:06 -05:00
William Hubbs
23cb55d843 man/start-stop-daemon.8: correct argument from --nice to --nicelevel
X-Gentoo-Bug: 510648
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=510648
2014-06-21 01:53:17 -05:00
William Hubbs
094bc17cb0 tmpfiles.sh: fix comment processing
If you happened to format a comment with no white space after the '#',
it was not being processed.

Reported-by: consus@gmx.com
X-Gentoo-Bug: 511804
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=511804
2014-06-20 19:39:07 -05:00
Sven Vermeulen
6126700a07 SELinux filesystem is at /sys/fs/selinux
The SELinux filesystem has been moved to /sys/fs/selinux for quite some
time. We kept supporting /selinux for backwards compatibility, but it's
time to move forward on this.

X-Gentoo-Bug: 511718
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=511718
Signed-off-by: Sven Vermeulen <sven.vermeulen@siphos.be>
2014-06-20 18:37:33 -05:00
Robin H. Johnson
19cccb2e94 sh/tmpfiles.sh: license under 2-clause BSD
As the author of our tmpfiles.sh script, I hereby license it under
2-clause BSD, like the rest of openrc.

Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
2014-06-20 16:19:25 -05:00
William Hubbs
9eb9b28d3e librc: filter out container processes on OpenVZ host
Thanks to info and testing done by Daniel Robbins <drobbins@funtoo.org>,
there is now a fix for this. Below is his description of the steps
OpenRC needed to use.

1) See if /proc/<pid>/status exists
2) If it does, see if it has a "envID:" field
3) If it does, see if "envID:" is set to "0"
4) If so, then it's one of the host's processes and should be a
candidate for the list. Otherwise, it is one of the container's
processes and should be ignored.

This should fix the bug and allow start-stop-daemon to work properly on
OpenVZ hosts.

X-Gentoo-Bug: 376817
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=376817
2014-06-20 16:01:47 -05:00
William Hubbs
a817915632 README.busybox: document incompatibility with built-in ip applet 2014-04-09 19:29:16 -05:00
Andrew Gregory
20d7b83150 tmpfiles.dev: remove --remove option
For compatibility with systemd.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
2014-04-03 12:39:27 -05:00
Andrew Gregory
686ee62a79 tmpfiles: add support for --boot option
For compatibility with systemd-tmpfiles.

Fixes #17

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
2014-03-27 11:36:41 -04:00
Andrew Gregory
c081633762 tmpfiles: ignore all files starting with systemd-
systemd recently moved creation of /run/nologin to systemd-nologin.conf

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
2014-03-27 11:36:41 -04:00
William Hubbs
e0e1f2a4da rc.conf: typo fix 2014-03-14 22:18:25 -05:00
William Hubbs
7fb209a6fc conf.d/hwclock: typo fix 2014-03-13 15:27:40 -05:00
William Hubbs
d0186d422c rc.conf: document rc_nocolor setting 2014-03-09 15:37:38 -05:00
Mike Frysinger
4ee8e90ffe devfs: explicitly mount /dev/shm with mode=1777
The current code relies on the tmpfs mount defaulting to 1777
permissions.  If it doesn't, things break badly.

This can come up when tmpfs is disabled in the kernel and ramfs
is being used instead (the kernel will alias tmpfs to ramfs).
The default permissions for ramfs is 0755.
2014-01-23 12:01:53 -06:00
William Hubbs
2cc6ef723a update feature removal schedule
- Remove the netifrc related items since netifrc is now a separate
  package.

- State that the features we are planning to remove will be removed
  in version 1.0.

- Clarify the last entry; we are refering to start-stop-daemon options.
2014-01-23 11:18:45 -06:00
William Hubbs
de186401e5 fstabinfo: fix mount and remount
The mount and remount options should always be processed. They were only
being processed if -q was not on the command line.

X-Gentoo-Bug: 498206
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=498206
2014-01-18 13:50:05 -06:00
William Hubbs
cdc0dd061b init-Linux.sh: do not mount /run with nosuid
This is so that we will be consistent with the systemd spec forr the
/run directory mentioned in this wiki article:

http://www.freedesktop.org/wiki/Software/systemd/InitrdInterface/
2014-01-18 02:34:39 -06:00
William Hubbs
561b53ef09 bootmisc: Remove console directories only if $RC_LIBEXECDIR is writable
X-Gentoo-Bug: 489368
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=489368
2014-01-15 10:43:52 -06:00
Benda Xu
abadaa04ab rc-update: add option to remove a service from all runlevels
The -a option,which only applies to the del command, is used to remove a
service from all runlevels.

X-Gentoo-Bug: 497740
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=497740
2014-01-13 10:41:38 -06:00
William Hubbs
54ab12d218 Merge init-common-post code into BSD init script
This code is no longer part of the initialization script for Linux, so
we can move it into the init script for *BSD which is the only place it
is used.
2014-01-11 13:32:43 -06:00
William Hubbs
257e10a1ab conf.d/keymaps: Remove the currency and euro symbols
A comment in this file had the actual currency and euro symbols, which
were not utf-8, so I was requested to remove them.

X-Gentoo-Bug: 494936
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=494936
2014-01-09 13:56:31 -06:00
William Hubbs
e5a94dd3f4 Add missing documentation for environment variables
Add documentation for the RC_SERVICE, RC_GOINGDOWN, RC_LIBEXECDIR and
RC_NO_UMOUNTS environment variables.

X-Gentoo-Bug: 489344
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=489344
2014-01-08 13:16:27 -06:00
William Hubbs
8352082eb6 devfs: add code to mount /dev
All Linux systems need /dev to be set up,so add code to devfs to do
this. The process devfs follows is below.

1. If static_dev is yes, nothing is done.
2. if /dev is an entry in fstab it is mounted or remounted based on that
entry.
3. If /dev is not in fstab, it attempts to mount /dev as a devtmpfs or
   tmpfs depending on which is defined in the kernel; devtmpfs is
   preferred.
4. If neither devtmpfs nor tmpfs is defined, it assumes the user wants
static /dev and prints a warning.

X-Gentoo-Bug: 492694
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=492694
2014-01-05 11:17:05 -06:00
William Hubbs
3470eda3f5 Rename runscript to openrc-run
This was requested by Debian, because the minicom software, which is
available on Debian and other distros, has a binary named runscript. We
are keeping a backward compatibility symlink for now, but this allows
Debian or any other distro to safely remove the symlink.

X-Gentoo-Bug: 494220
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=494220
2013-12-29 22:57:31 -06:00
William Hubbs
c096ad63ca add openrc binary to ignore patterns 2013-12-13 12:19:27 -06:00
William Hubbs
7a35daeab7 runscript: clarify the message wrt scheduling
The message about a service being scheduled to start was confusing to
some of our users; I was told this wording is more clear.

X-Gentoo-Bug: 493070
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=493070
2013-12-13 01:09:55 -06:00
William Hubbs
7b5fa011ac Rename the rc binary to openrc
Debian requested this rename due to the "rc" binary conflicting with the
"rc" binary from the plan 9 shell.

We also add a deprecation warning to the binary when it is run as rc to
encourage users to switch to openrc instead.

X-Gentoo-Bug: 493958
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=493958
2013-12-12 18:31:29 -06:00
William Hubbs
09733d3fae tmpfiles.sh: small fixes
Change "sort | uniq" to "sort -u". Also, change `...` to $(...).

X-Gentoo-Bug: 493736
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=493736
2013-12-10 22:34:40 -06:00
William Hubbs
7230b29bf3 rc.conf: Sync list of network file systems with actual defaults
I would like to thank Aaron Ten Clay <aarontc@aarontc.com> for pointing
this out; this is based on a patch he submitted.

X-Gentoo-Bug: 491384
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=491384
2013-12-08 13:40:23 -06:00
Petre Rodan
235f94c4c5 bootmisc.in: fix boot order
Bootmisc was running before the root file system was remounted rw in
some situations. This fixes that issue.

X-Gentoo-Bug: 493442
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=493442
2013-12-08 12:42:31 -06:00
Andrew Gregory
d711663189 network.in: skip loopback device
The loopback interface is supposed to be handled by the loopback
service, but sys_interfaces includes it.  This causes network to try to
start it and means that network provides net even if lo is the only
interface configured.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
2013-12-06 13:24:58 -06:00
William Hubbs
60d288a877 remove type command
The posix equivalent of the type command is "command -v", so now we use
that. Thanks to Jonathan Callen <jcallen@gentoo.org> for informing me
wrt the fix.
2013-12-02 02:08:40 -06:00
William Hubbs
1fccf91df1 rc-update: make "service already installed" message informational
This message was being sent to stderr, and it should be sent to
stdout since it is informational. This change was requested by
zero_chaos.
2013-12-01 11:20:29 -06:00
Mike Frysinger
af30c4b86e functions.sh: yesno: (mostly) fix eval logic
We need to quote the expansion.

X-Gentoo-Bug: 475032
X-Gentoo-Bug: https://bugs.gentoo.org/475032
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2013-11-30 16:33:31 -05:00
William Hubbs
6965d85f2e Fix the service-level rc_verbose setting
This commit fixes the rc_verbose setting so that it is honored if it is
set for an individual service.

Thanks to whissi@whissi.de for the original patch; this one is slightly
modified to be more posix.

X-Gentoo-Bug: 489358
X-Gentoo-Bug: https://bugs.gentoo.org/show_bug.cgi?id=489358
2013-10-31 16:04:19 -05:00
Steven Chamberlain
766d71c2d3 Begin port to GNU/kFreeBSD
This is just a minimal port to get Debian up and running; the rest will
be done later.
2013-10-30 01:40:03 -05:00
William Hubbs
579838d2e7 bootmisc: do not run clean_run on VSERVER systems
X-Gentoo-Bug: 489370
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=489370
2013-10-28 15:21:50 -05:00
William Hubbs
9238d94d64 loopback: do not run in a prefix or vserver
X-Gentoo-Bug: 489370
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=489370
2013-10-28 12:37:22 -05:00
William Hubbs
aeb670f4e8 librc: do not allow "." and ".." as runlevel names
The rc_runlevel_exists function was attempting to treat "." and ".." as
valid runlevels; however, this should not be allowed.

X-Gentoo-Bug: 488710
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=488710
2013-10-21 14:21:22 -05:00
William Hubbs
48981be8a8 Revert "Make einfo routines private"
This reverts commit de88aff0a8.
I was advised that splashutils links to libeinfo, so we do have a
consumer for this library.
2013-10-21 13:49:41 -05:00
William Hubbs
d2988dc7dd remove redundant sync calls
The localmount and mount-ro scripts were flushing pending disk writes by
calling sync twice in succession. This is no longer necessary; see the
bug report and blog post for reasons we were still doing this.

Reported-by: Patrick Lauer <patrick@gentoo.org>
X-Gentoo-Bug: 487382
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=487382
2013-10-18 16:32:51 -05:00
Alexander V Vershilov
66970394ab Add uml keyword to fsck service.
Fix relevant an issue mentioned by Toralf Förster.

X-Gentoo-Bug: 481096.
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=481096
2013-10-14 17:05:19 -05:00
William Hubbs
f751e14416 convert flock() messages to verbose warnings
Convert these messages to warnings that are only displayed if
EINFO_VERBOSE is set to yes in the environment.

This is based on a suggestion from Patrick Lauer <patrick@gentoo.org>.

X-Gentoo-Bug: 487588
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=487588
2013-10-12 09:38:09 -05:00
William Hubbs
4b37d3b16f netmount: add -lxc keyword
Netmount should not run on lxc, thanks to Mark van Dijk <funtoo@internecto.net>.
2013-10-08 10:34:45 -05:00
William Hubbs
82378bd92d start-stop-daemon: fix do_stop calls
Several calls to do_stop were forcing the test parameter to be true,
which was causing extra output to the terminal, such as:

* Would send signal 0 to pid xxxxx

This should only happen if the --test command line option was used.
2013-10-06 12:00:37 -05:00
Daniel Robbins
e6df76a377 FL-786: localmount: support filesystem mounting on openvz 2013-10-04 15:16:05 -05:00
Natanael Copa
03c67bcc27 librc: fix a read off-by-one bug
We should first check if we are within bounds and then read rather than
the opposite.

This makes valgrind happy.

Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
2013-10-04 14:02:02 -05:00
Natanael Copa
681a37e7bd librc: fix off-by-one bug
We need allocate space for both the added leading '-' and the trailing
'\0'.

Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
2013-10-04 14:01:46 -05:00
William Hubbs
56d592866c start-stop-daemon: fix eerorr calls in get_pid
The eerror calls in this function make it too verbose, so change them to
ewarnv() calls instead. This means that they will only print if the
--verbose option is used or EINFO_VERBOSE=yes is set in the environment.
2013-09-30 16:55:25 -05:00
William Hubbs
993e7d7044 fix cgroup_cleanup function
The yesno test for rc_cgroup_cleanup belongs at the point where this
function is called from runscript, not in the function itself.

X-Gentoo-Bug: 486210
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=486210
2013-09-27 15:55:46 -05:00
William Hubbs
de88aff0a8 Make einfo routines private
The libeinfo library has no consumers other than OpenRC, so there is no
reason for it to be maintained as a library. The einfo routines are now
an object that links with the rc binary.
2013-09-26 22:18:21 -05:00
William Hubbs
9e989227ab start-stop-daemon: remove the verbose variable
Along the same lines as the quiet variable, this is controlled by an
environment variable for the einfo code, so we do not need a separate
boolean flag.
2013-09-24 01:47:17 -05:00
William Hubbs
d6436bed09 start-stop-daemon: remove the quiet variable
The suppression of output is controlled in the e* functions themselves,
so there is no need for a variable to test in start-stop-daemon.

X-Gentoo-Bug: 482396
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=482396
2013-09-23 17:28:39 -05:00
William Hubbs
4480f1f395 rc: add service to ignore patterns 2013-09-23 13:37:21 -05:00
William Hubbs
0ba14ae720 style fixes 2013-09-23 12:40:26 -05:00
Alexander V Vershilov
7716bf31de Fix stacked runlevel support
Patch was provided by  Max Hacking <max.gentoo.bugzilla@hacking.co.uk>
and slightly fixed by Alexander Vershilov <qnikst@gentoo.org> and
William Hubbs <williamh@gentoo.org>.

Fixes:
1). Rebase to newest OpenRC version.
2). Remove code style fixes. Port to currect code style.
3). Fix rc_runlevel_stack instead of introducing new function.
4). Make get_runlevel_chain a private function.

X-Gentoo-Bug: 467368
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=467368
2013-09-20 14:27:31 -05:00
William Hubbs
445b297360 rc: add support for suppressing error messages
Add support for suppressing error messages with --quiet specified twice
on the command line.

X-Gentoo-Bug: 482396
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=482396
2013-09-03 19:05:13 -05:00
William Hubbs
2590bf7a2b libeinfo: add separate variable to suppress eerror messages
Add an EERROR_QUIET environment variable which works like EINFO_QUIET
but for the eerror functions. This will allow library consumers to
choose whether to suppress eerror messages separately from einfo and
ewarn messages.

X-Gentoo-Bug: 482396
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=482396
2013-09-03 13:03:55 -05:00
William Hubbs
4ce3cb90a0 init.d: update ignore patterns
Remove net.lo* from the ignore pattern since these scripts are no longer
part of OpenRC and add loopback and tmpfiles.dev.
2013-09-01 16:30:18 -05:00
William Hubbs
a78b18e291 libeinfo: suppress output for eerror* functions
This makes the eerror* functions honor the EINFO_QUIET environment
variable like the einfo* and ewarn* functions.

X-Gentoo-Bug: 482396
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=482396
2013-08-28 14:23:46 -05:00
William Hubbs
72b58b9e6b Revert "Libeinfo: do not suppress ewarn() messages"
This reverts commit 4ee62c7903.

The previously referenced commit broke consistency because ewarnx() was
respecting the EINFO_QUIET environment setting, but after this commit,
ewarn() was not.
Also, due to discussion on the below referenced bugs, I think we do
want to suppress warnings when EINFO_QUIET=yes.

X-Gentoo-Bug: 482396
X-Gentoo-Bug: 439174
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=482396
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=439174
2013-08-27 10:26:48 -05:00
William Hubbs
5c3e5d801b start-stop-daemon: remove redundant test of the quiet value
The einfo() function tests for the EINFO_QUIET environment variable
directly, and this is the variable that is set by the --quiet flag, so
there was no reason for this test to exist.
2013-08-26 17:09:18 -05:00
William Hubbs
bb8a9c087d start-stop-daemon: fix --quiet switch
The --quiet switch wasn't really quiet, because we changed it to report
errors. I am changing it back due to discussions on the listed bugs.

X-Gentoo-Bug: 482396
X-Gentoo-Bug: 439174
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=482396
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=439174
2013-08-26 15:51:11 -05:00
William Hubbs
d1b183a2f9 increment version 2013-08-24 17:59:19 -05:00
William Hubbs
7296379f3f man/runscript.8: minor grammar fixes 2013-08-24 11:57:22 -05:00
William Hubbs
1f5d447eda fix typo on runscript man page
The example code had an invalid checkpath option (--dir instead of
--directory) and a mode that does not make sense for directories (664
instead of 775).

X-Gentoo-Bug: 481034
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=481034
2013-08-15 10:14:42 -05:00
149 changed files with 2419 additions and 622 deletions

View File

@@ -5,29 +5,9 @@ removed, it should also be removed from this file.
---------------------------
What: oldnet ADSL rp-pppoe mode
When: undecided
Why: Replaced by the oldnet PPP module
Who: Robin H. Johnson <robbat2@gentoo.org>
---------------------------
What: oldnet /etc/conf.d/wireless
When: undecided
Why: All configuration moved to /etc/conf.d/net
Who: Robin H. Johnson <robbat2@gentoo.org>
---------------------------
What: Service pause action
When: Removed already, compatbility warning in place.
When: 1.0
Why: ...
@@ -35,9 +15,9 @@ Who:
---------------------------
What: Service --startas, --chuid , --oknodo
What: start-stop-daemon options --startas, --chuid , --oknodo
When: undecided
When: 1.0
Why: Obsolete or replaced by other options.
--startas => use --name or --exec
@@ -47,3 +27,46 @@ Why: Obsolete or replaced by other options.
Who:
---------------------------
What: runscript and rc symbolic links
When: 1.0
Why: Deprecated in favor of openrc-run and openrc due to naming
conflicts with other software.
Who:
---------------------------
What: support for the opts variable in service scripts
When: 1.0
Why: Depprecated in favor of extra_commands, extra_started_commands
and extra_stopped_commands.
Who:
---------------------------
What: support for local_start and local_stop
When: 1.0
Why: Depprecated in favor of executable scripts in @SYSCONFDIR@/local.d
Who:
---------------------------
What: the mtab service script
When: make warnings more visible in 1.0, remove in 2.0
Why: /etc/mtab should be a symbolic link to /proc/self/mounts on modern
Linux systems
Who:
---------------------------

View File

@@ -1,3 +1,3 @@
NAME= openrc
VERSION= 0.12.4
VERSION= 0.13.2
PKG= ${NAME}-${VERSION}

44
NEWS Normal file
View File

@@ -0,0 +1,44 @@
OpenRC NEWS
This file will contain a list of notable changes for each release.
OpenRC-0.13.2
=============
A chroot variable has been added to the service script variables.
This fixes the support for running a service in a chroot.
This is documented in man 8 openrc-run.
The netmount service now mounts nfs file systems.
This change was made to correct a fix for an earlier bug.
OpenRC-0.13
===========
/sbin/rc was renamed to /sbin/openrc and /sbin/runscript was renamed to
/sbin/openrc-run due to naming conflicts with other software.
Backward compatible symbolic links are currently in place so your
system will keep working if you are using the old names; however, it is
strongly advised that you migrate to the new names because the symbolic
links will be removed in the future.
Warnings have been added to assist with this migration; however, due to the
level of noise they produce, they only appear in verbose mode in this release.
The devfs script now handles the initial mounting and setup of the
/dev directory. If /dev has already been mounted by the kernel or an
initramfs, devfs will remount /dev with the correct mount options
instead of mounting a second /dev over the existing mount point.
It attempts to mount /dev from fstab first if an entry exists there. If
it doesn't it attempts to mount devtmpfs if it is configured in the
kernel. If not, it attempts to mount tmpfs.
If none of these is available, an error message is displayed and static
/dev is assumed.
OpenRC-0.12
===========
The net.* scripts, originally from Gentoo Linux, have
been removed. If you need these scripts, look for a package called
netifrc, which is maintained by them.

26
README
View File

@@ -57,10 +57,6 @@ init.d.misc is not installed by default as the scripts will need
tweaking on a per distro basis. They are also non essential to the operation
of the system.
As of OpenRC-0.12, the net.* scripts, originally from Gentoo Linux, have
been removed. If you need these scripts, look for a package called
netifrc, which is maintained by them.
Reporting Bugs
--------------
Since Gentoo Linux is hosting OpenRC development, Bugs should go to
@@ -68,25 +64,3 @@ the Gentoo Bugzilla:
http://bugs.gentoo.org/
They should be filed under the "Gentoo Hosted Projects" product and
the "openrc" component.
History - by Roy Marples
------------------------
I became a Gentoo/Linux developer in 2004 and wrote the modular network
scripts for the Gentoo baselayout package. baselayout is a collection of
bash scripts to bring up your computer and its services.
Then towards the end of 2005 I found myself as the primary maintainer
for baselayout.
At the start of 2007, baselayout-2 is announced to the world, re-writing the
core of baselayout in C and allowing POSIX sh init scripts instead of
forcing the use of bash. By Mid 2007 I have re-written everything, including
init scripts, and alpha and pre baselayout-2 snapshots where put into Gentoo.
Towards the end of 2007 I retired as a Gentoo developer for reasons I won't
go into here. baselayout-2 was still in the pre stage, and aside from the
fbsd users, it was masked everywhere. However, I also desired to keep the
baselayout-2 project alive, but outside of Gentoo and into other projects
such as FreeBSD.
As such, the Gentoo Council have allowed the creation of OpenRC under the
2 clause BSD license, managed by me as an external project.

View File

@@ -8,21 +8,24 @@ counterparts. Since it is possible to configure busybox to not include
these applets or to prefer the standalone counterparts, OpenRC does not
attempt to support the busybox applets.
All of these apply to busybox 1.20.2, which is the current version of
busybox as of this writing.
For now, it is recommended that you disable the following busybox
configuration settings for best results with OpenRC.
1. The start-stop-daemon applet is not compatible with start-stop-daemon
in OpenRC. Please make sure CONFIG_START_STOP_DAEMON is not set to y in
the configuration file you use to build busybox.
CONFIG_START_STOP_DAEMON -- The start-stop-daemon applet is not compatible with
start-stop-daemon in OpenRC.
2. The -O option for the mount applet does not support the [no]_netdev
options from util-linux for handling network file systems.
CONFIG_MOUNT -- The mount applet does not support the -O [no]_netdev options to
skip over or include network file systems when the -a option is present.
3. The umount applet does not support the -O option from util-linux.
CONFIG_UMOUNT -- The umount applet does not support the -O option along with -a.
4. The swapon applet does not support the -e option from util-linux.
CONFIG_SWAPONOFF -- The swapon applet does not support the -e option
or recognize the nofail option in fstab.
5. the setfont applet does not support the -u option from kbd.
CONFIG_SETFONT -- The setfont applet does not support the -u option from kbd.
CONFIG_IP -- The ip applet doesn't support the "scope" modifier for
"ip route add" and "ip address add".
There is work to get most of these supported by busybox, so this file
will be updated as things change.

55
README.history Normal file
View File

@@ -0,0 +1,55 @@
This history of OpenRC was written by Daniel Robbins, Roy Marples, William
Hubbs and others.
The Gentoo modular init scripts were developed by Daniel Robbins for Gentoo
Linux 1.0_rc6 during most of 2001 and released in September 2001. After their
development, the dependency-based init script system was maintained by a
number of senior developers, starting with Azarah (Martin Schlemmer), with
migration to the new init system assisted by Woodchip (Donnie Davies) who
converted all ebuild init scripts to work with the new system. As Grant
Goodyear notes:
"My recollection is that one of woodchip's more impressive early feats
was the complete replacement of all of the init scripts in Portage
for Gentoo Linux 1.0_rc6. Through 1.0_rc5 Gentoo had used fairly
standard rc scripts modified from Stampede Linux, but for 1.0_rc6 Daniel
Robbins (drobbins) and Martin Schlemmer (azarah) had created a new
dependency-based init script system that is still used today. Within a
span of days Donny rewrote every single init script in the Portage tree
and committed new masked packages to await the release of 1.0_rc6. Thanks to
woodchip (and drobbins and azarah, of course) the
transition to the new init scripts was nearly painless." [1]
Roy Marples became a Gentoo/Linux developer in 2004 and wrote the modular
network scripts for the Gentoo baselayout package. Towards the end of 2005,
he became the primary maintainer for baselayout and the init scripts.
At the start of 2007, He announced the ongoing development of
baselayout-2, containing a rewritten core coded in C and allowing POSIX sh
init scripts instead of forcing the use of bash. By mid 2007, He had
re-implemented the Gentoo init script design created by Daniel Robbins,
using an entirely new code base. Alpha and pre-release baselayout-2
snapshots were added to Gentoo's Portage tree as an optional component.
Toward the end of 2007, Roy retired as a Gentoo developer.
Baselayout-2 was still in the pre stage, and aside from the gentoo-fbsd
users, it was masked. However, He desired to keep the baselayout-2
project moving forward as an independent project. The Gentoo Council
permitted Him to release OpenRC under the 2-clause BSD license,
managed by him as an external project.
Around mid-2010, Roy decided to no longer maintain OpenRC. At this
point, he transferred development back to Gentoo.
William Hubbs, and several other Gentoo developers, started working on
OpenRC around this point and brought OpenRC-0.8.x to Gentoo Linux's stable
tree in 2011.
In 2013 the OpenRC team became independent from Gentoo again and moved primary
development to github.
Daniel Robbins continues to maintain an independent, forked
version of OpenRC for Funtoo Linux, which includes a Funtoo-specific network
configuration system.
[1] http://www.gentoo.org/news/en/gwn/20040426-newsletter.xml

View File

@@ -15,7 +15,7 @@ include ${MK}/os.mk
CONF-FreeBSD= ipfw moused powerd rarpd savecore syscons
CONF-Linux= consolefont dmesg hwclock keymaps killprocs modules
CONF-Linux= consolefont devfs dmesg hwclock keymaps killprocs modules
CONF-NetBSD= moused rarpd savecore

8
conf.d/devfs Normal file
View File

@@ -0,0 +1,8 @@
# OpenRC will attempt each of the following in succession to mount /dev.
#
# 1. If there is an entry for /dev in fstab, it will be used.
# 2. If devtmpfs is defined in the kernel, it will be used.
# 3. If tmpfs is defined in the kernel, it will be used.
#
# Set this to yes if you do not want OpenRC to attempt to mount /dev.
# skip_mount_dev="NO"

View File

@@ -7,8 +7,8 @@ clock="UTC"
# If you want the hwclock script to set the system time (software clock)
# to match the current hardware clock during bootup, leave this
# commented out.
# However, you can set this to "NO" ifyou are running a modern kernel
# with CONFIG_RTC_HCTOSYS set to y and your hardware clock set to UTC.
# However, you can set this to "NO" if you are running a modern kernel
# and using NTP to synchronize your system clock.
#clock_hctosys="YES"
# If you do not want to set the hardware clock to the current system

View File

@@ -18,6 +18,6 @@ extended_keymaps=""
# For a list of valid sets, run `dumpkeys --help`
dumpkeys_charset=""
# Some fonts map AltGr-E to the currency symbol ¤ instead of the Euro
# Some fonts map AltGr-E to the currency symbol instead of the Euro.
# To fix this, set to "yes"
fix_euro="NO"

View File

@@ -0,0 +1,4 @@
# You can assign a default route
#defaultroute="192.168.0.1"
#defaultroute6="2001:a:b:c"

4
conf.d/network.GNU.in Normal file
View File

@@ -0,0 +1,4 @@
# You can assign a default route
#defaultroute="gw 192.168.0.1"
#defaultroute6="gw 2001:a:b:c"

View File

@@ -0,0 +1,5 @@
# Separate multiple routes using ; or new lines.
# Example static routes. See route(8) for syntax.
#staticroute="net 192.168.0.0 10.73.1.1 netmask 255.255.255.0
#net 192.168.1.0 10.73.1.1 netmask 255.255.255.0"

View File

@@ -0,0 +1,7 @@
# Separate multiple routes using ; or new lines.
# /etc/route.conf(5) takes precedence over this configuration.
# Example static routes. See route(8) for syntax.
# FIXME: "net ..." not supported
#staticroute="net 192.168.0.0 -netmask 255.255.255.0 --address 10.73.1.1
#net 192.168.1.0 -netmask 255.255.255.0 --address 10.73.1.1"

14
etc/rc.conf.GNU Normal file
View File

@@ -0,0 +1,14 @@
##############################################################################
# GNU/Hurd SPECIFIC OPTIONS
# This is the subsystem type. Valid options on GNU/Hurd:
# "" - nothing special
# "subhurd" - Hurd subhurds (to be checked)
# If this is commented out, automatic detection will be used.
#
# This should be set to the value representing the environment this file is
# PRESENTLY in, not the virtualization the environment is capable of.
#rc_sys=""
# This is the number of tty's used in most of the rc-scripts (like
# consolefont, numlock, etc ...)
#rc_tty_number=6?

View File

@@ -51,6 +51,10 @@
# The default value is: /var/log/rc.log
#rc_log_path="/var/log/rc.log"
# If you want verbose output for OpenRC, set this to yes. If you want
# verbose output for service foo only, set it to yes in /etc/conf.d/foo.
#rc_verbose=no
# By default we filter the environment for our running scripts. To allow other
# variables through, add them here. Use a * to allow all variables through.
#rc_env_allow="VAR1 VAR2"
@@ -73,6 +77,10 @@
#rc_crashed_stop=NO
#rc_crashed_start=YES
# Set rc_nocolor to yes if you do not want colors displayed in OpenRC
# output.
#rc_nocolor=NO
##############################################################################
# MISC CONFIGURATION VARIABLES
# There variables are shared between many init scripts
@@ -86,7 +94,7 @@
# Below is the default list of network fstypes.
#
# afs cifs coda davfs fuse fuse.sshfs gfs glusterfs lustre ncpfs
# afs ceph cifs coda davfs fuse fuse.sshfs gfs glusterfs lustre ncpfs
# nfs nfs4 ocfs2 shfs smbfs
#
# If you would like to add to this list, you can do so by adding your

View File

@@ -1,4 +1,4 @@
#!@SBINDIR@/runscript
#!@SBINDIR@/openrc-run
# Copyright (c) 2007-2008 Roy Marples <roy@marples.name>
# Released under the 2-clause BSD license.

View File

@@ -1,4 +1,4 @@
#!@SBINDIR@/runscript
#!@SBINDIR@/openrc-run
# Copyright (c) 2007-2008 Roy Marples <roy@marples.name>
# Released under the 2-clause BSD license.

View File

@@ -1,4 +1,4 @@
#!@SBINDIR@/runscript
#!@SBINDIR@/openrc-run
# Copyright (c) 2007-2008 Roy Marples <roy@marples.name>
# Released under the 2-clause BSD license.

View File

@@ -1,4 +1,4 @@
#!@SBINDIR@/runscript
#!@SBINDIR@/openrc-run
# Copyright (c) 2009 Roy Marples <roy@marples.name>
# Released under the 2-clause BSD license.

View File

@@ -1,4 +1,4 @@
#!@SBINDIR@/runscript
#!@SBINDIR@/openrc-run
# Copyright (c) 2007-2008 Roy Marples <roy@marples.name>
# Released under the 2-clause BSD license.

View File

@@ -1,4 +1,4 @@
#!@SBINDIR@/runscript
#!@SBINDIR@/openrc-run
# Copyright (c) 2007-2008 Roy Marples <roy@marples.name>
# Released under the 2-clause BSD license.

View File

@@ -1,4 +1,4 @@
#!@SBINDIR@/runscript
#!@SBINDIR@/openrc-run
# Copyright (c) 2007-2008 Roy Marples <roy@marples.name>
# Released under the 2-clause BSD license.

View File

@@ -1,4 +1,4 @@
#!@SBINDIR@/runscript
#!@SBINDIR@/openrc-run
# Copyright (c) 2007-2009 Roy Marples <roy@marples.name>
# Released under the 2-clause BSD license.

View File

@@ -1,4 +1,4 @@
#!@SBINDIR@/runscript
#!@SBINDIR@/openrc-run
# Copyright (c) 2007-2008 Roy Marples <roy@marples.name>
# Released under the 2-clause BSD license.
@@ -53,7 +53,7 @@ start_pre()
eend $?
fi
else
if type kldload >/dev/null 2>&1; then
if command -v kldload >/dev/null 2>&1; then
# Hammer the modules home by default
sysctl -a | grep -q '\.tun\.' || kldload if_tun
sysctl -a | grep -q '\.tap\.' || kldload if_tap

View File

@@ -1,4 +1,4 @@
#!@SBINDIR@/runscript
#!@SBINDIR@/openrc-run
# Copyright (c) 2007-2008 Roy Marples <roy@marples.name>
# Released under the 2-clause BSD license.

View File

@@ -1,4 +1,4 @@
#!@SBINDIR@/runscript
#!@SBINDIR@/openrc-run
# Copyright (c) 2007-2008 Roy Marples <roy@marples.name>
# Released under the 2-clause BSD license.

View File

@@ -1,4 +1,4 @@
#!@SBINDIR@/runscript
#!@SBINDIR@/openrc-run
# Copyright (c) 2009 Roy Marples <roy@marples.name>
# Released under the 2-clause BSD license.

4
init.d/.gitignore vendored
View File

@@ -3,9 +3,8 @@ fsck
hostname
local
localmount
loopback
moused
net.lo
net.lo0
netmount
network
root
@@ -41,4 +40,5 @@ syslogd
termencoding
ttys
wscons
tmpfiles.dev
tmpfiles.setup

View File

@@ -1,4 +1,4 @@
#!@SBINDIR@/runscript
#!@SBINDIR@/openrc-run
# Copyright (c) 2007-2009 Roy Marples <roy@marples.name>
# Released under the 2-clause BSD license.

View File

@@ -1,4 +1,4 @@
#!@SBINDIR@/runscript
#!@SBINDIR@/openrc-run
# Copyright (c) 2007-2009 Roy Marples <roy@marples.name>
# Released under the 2-clause BSD license.
@@ -6,7 +6,7 @@ depend()
{
need localmount
before logger
after clock sysctl
after clock root sysctl
keyword -prefix -timeout
}
@@ -68,7 +68,7 @@ cleanup_var_run_dir()
do
# Clean stale sockets
if [ -S "$x" ]; then
if type fuser >/dev/null 2>&1; then
if command -v fuser >/dev/null 2>&1; then
fuser "$x" >/dev/null 2>&1 || rm -- "$x"
else
rm -- "$x"
@@ -117,7 +117,7 @@ migrate_to_run()
clean_run()
{
[ "$RC_SYS" = VSERVER ] && return 0
[ "$RC_SYS" = VSERVER -o "$RC_SYS" = LXC ] && return 0
local dir
dir=$(mktemp -d)
mount --bind / $dir
@@ -129,7 +129,9 @@ clean_run()
start()
{
# Remove any added console dirs
rm -rf "$RC_LIBEXECDIR"/console/*
if checkpath -W "$RC_LIBEXECDIR"; then
rm -rf "$RC_LIBEXECDIR"/console/*
fi
local logw=false runw=false extra=
# Ensure that our basic dirs exist

View File

@@ -1,4 +1,4 @@
#!@SBINDIR@/runscript
#!@SBINDIR@/openrc-run
# Copyright (c) 2007-2009 Roy Marples <roy@marples.name>
# Released under the 2-clause BSD license.

View File

@@ -1,4 +1,4 @@
#!@SBINDIR@/runscript
#!@SBINDIR@/openrc-run
# Copyright (c) 2007-2008 Roy Marples <roy@marples.name>
# Released under the 2-clause BSD license.

View File

@@ -1,4 +1,4 @@
#!@SBINDIR@/runscript
#!@SBINDIR@/openrc-run
# Copyright (c) 2008 Roy Marples <roy@marples.name>
# Released under the 2-clause BSD license.

View File

@@ -1,21 +1,79 @@
#!@SBINDIR@/runscript
#!@SBINDIR@/openrc-run
# Copyright (c) 2007-2008 Roy Marples <roy@marples.name>
# Released under the 2-clause BSD license.
description="Mount system critical filesystems in /dev."
description="Set up the /dev directory"
depend() {
use dev-mount
depend()
{
provide dev-mount
before dev
keyword -prefix -vserver -lxc
}
start() {
mount_dev()
{
local action=--mount devfstype msg=Mounting
# Some devices require exec, Bug #92921
local mountopts="exec,nosuid,mode=0755"
if yesno ${skip_mount_dev:-no} ; then
einfo "/dev will not be mounted due to user request"
return 0
fi
if mountinfo -q /dev; then
action=--remount
mountopts="remount,$mountopts"
msg=Remounting
fi
if fstabinfo -q /dev; then
ebegin "$msg /dev according to @SYSCONFDIR@/fstab"
fstabinfo -q $action /dev
eend $?
return 0
fi
if grep -q devtmpfs /proc/filesystems; then
devfstype=devtmpfs
mountopts="$mountopts,size=10M"
elif grep -q tmpfs /proc/filesystems; then
devfstype=tmpfs
mountopts="$mountopts,size=10M"
fi
if [ -n "$devfstype" ]; then
ebegin "$msg $devfstype on /dev"
mount -n -t $devfstype -o $mountopts dev /dev
eend $?
else
ewarn "This kernel does not have devtmpfs or tmpfs support, and there"
ewarn "is no entry for /dev in fstab."
ewarn "This means /dev will not be mounted."
ewarn "To avoid this message, set CONFIG_DEVTMPFS or CONFIG_TMPFS to y"
ewarn "in your kernel configuration or see @SYSCONFDIR@/conf.d/devfs"
fi
return 0
}
seed_dev()
{
# Seed /dev with some things that we know we need
# creating /dev/console, /dev/tty and /dev/tty1 to be able to write
# to $CONSOLE with/without bootsplash before udevd creates it
[ -c /dev/console ] || mknod -m 600 /dev/console c 5 1
[ -c /dev/tty1 ] || mknod -m 620 /dev/tty1 c 4 1
[ -c /dev/tty ] || mknod -m 666 /dev/tty c 5 0
# udevd will dup its stdin/stdout/stderr to /dev/null
# and we do not want a file which gets buffered in ram
[ -c /dev/null ] || mknod -m 666 /dev/null c 1 3
# so udev can add its start-message to dmesg
[ -c /dev/kmsg ] || mknod -m 660 /dev/kmsg c 1 11
# Mount required stuff as user may not have then in /etc/fstab
for x in \
"mqueue /dev/mqueue 1777 ,nodev mqueue" \
"devpts /dev/pts 0755 ,gid=5,mode=0620 devpts" \
"tmpfs /dev/shm 1777 ,nodev shm" \
"tmpfs /dev/shm 1777 ,nodev,mode=1777 shm" \
; do
set -- $x
grep -Eq "[[:space:]]+$1$" /proc/filesystems || continue
@@ -34,5 +92,23 @@ start() {
eend $?
fi
done
}
restorecon_dev()
{
if [ -x /sbin/restorecon ]; then
ebegin "Restoring SELinux contexts in /dev"
restorecon -rF /dev >/dev/null 2>&1
eend $?
fi
return 0
}
start()
{
mount_dev
seed_dev
restorecon_dev
return 0
}

View File

@@ -1,4 +1,4 @@
#!@SBINDIR@/runscript
#!@SBINDIR@/openrc-run
# Copyright (c) 2007-2008 Roy Marples <roy@marples.name>
# Released under the 2-clause BSD license.

View File

@@ -1,4 +1,4 @@
#!@SBINDIR@/runscript
#!@SBINDIR@/openrc-run
# Copyright (c) 2007-2008 Roy Marples <roy@marples.name>
# Released under the 2-clause BSD license.

View File

@@ -1,4 +1,4 @@
#!@SBINDIR@/runscript
#!@SBINDIR@/openrc-run
# Copyright 1992-2012 FreeBSD Project
# Released under the 2-clause BSD license

View File

@@ -1,4 +1,4 @@
#!@SBINDIR@/runscript
#!@SBINDIR@/openrc-run
# Copyright (c) 2007-2009 Roy Marples <roy@marples.name>
# Released under the 2-clause BSD license.

View File

@@ -1,4 +1,4 @@
#!@SBINDIR@/runscript
#!@SBINDIR@/openrc-run
# Copyright (c) 2007-2009 Roy Marples <roy@marples.name>
# Released under the 2-clause BSD license.
@@ -40,7 +40,7 @@ reset()
{
local uuid= x="[0-9a-f]" y="$x$x$x$x"
if type kenv >/dev/null 2>&1; then
if command -v kenv >/dev/null 2>&1; then
uuid=$(kenv smbios.system.uuid 2>/dev/null)
fi
case "$uuid" in

View File

@@ -1,4 +1,4 @@
#!@SBINDIR@/runscript
#!@SBINDIR@/openrc-run
# Copyright (c) 2007-2009 Roy Marples <roy@marples.name>
# Released under the 2-clause BSD license.

View File

@@ -1,4 +1,4 @@
#!@SBINDIR@/runscript
#!@SBINDIR@/openrc-run
# Copyright (c) 2007-2008 Roy Marples <roy@marples.name>
# Released under the 2-clause BSD license.
@@ -83,22 +83,17 @@ start()
fi
fi
# Always set the kernel's time zone.
_hwclock --systz $utc_cmd $clock_args
: $(( retval += $? ))
if [ -e /etc/adjtime ] && yesno $clock_adjfile; then
_hwclock --adjust $utc_cmd
: $(( retval += $? ))
fi
# If setting UTC, don't bother to run hwclock when first booting
# as that's the default
if [ "$PREVLEVEL" != N -o \
"$utc_cmd" != --utc -o \
-n "$clock_args" ];
then
if yesno ${clock_hctosys:-YES}; then
_hwclock --hctosys $utc_cmd $clock_args
else
_hwclock --systz $utc_cmd $clock_args
fi
if yesno ${clock_hctosys:-YES}; then
_hwclock --hctosys $utc_cmd $clock_args
: $(( retval += $? ))
fi

View File

@@ -1,4 +1,4 @@
#!@SBINDIR@/runscript
#!@SBINDIR@/openrc-run
# Copyright (c) 2007-2009 Roy Marples <roy@marples.name>
# Released under the 2-clause BSD license.

View File

@@ -1,4 +1,4 @@
#!@SBINDIR@/runscript
#!@SBINDIR@/openrc-run
# Copyright (c) 2007-2008 Roy Marples <roy@marples.name>
# Released under the 2-clause BSD license.

View File

@@ -1,4 +1,4 @@
#!@SBINDIR@/runscript
#!@SBINDIR@/openrc-run
# Copyright (c) 2007-2008 Roy Marples <roy@marples.name>
# Released under the 2-clause BSD license.

View File

@@ -1,4 +1,4 @@
#!@SBINDIR@/runscript
#!@SBINDIR@/openrc-run
# Copyright (c) 2007-2008 Roy Marples <roy@marples.name>
# Released under the 2-clause BSD license.
@@ -12,40 +12,73 @@ depend()
start()
{
einfo "Starting local"
ebegin "Starting local"
local file
for file in @SYSCONFDIR@/local.d/*.start ; do
[ -x "$file" ] && "$file"
local file has_errors=0 retval
eindent
for file in @SYSCONFDIR@/local.d/*.start; do
if [ -x "${file}" ]; then
vebegin "Executing \"${file}\""
"${file}" 2>&1 >/dev/null
retval=$?
if [ ${retval} -ne 0 ]; then
has_errors=1
fi
veend ${retval} "Execution of \"${file}\" failed."
fi
done
eoutdent
if type local_start >/dev/null 2>&1; then
ewarn "@SYSCONFDIR@/conf.d/local should be removed."
if command -v local_start >/dev/null 2>&1; then
ewarn "\"@SYSCONFDIR@/conf.d/local\" should be removed."
ewarn "Please move the code from the local_start function"
ewarn "to scripts with an .start extension"
ewarn "in @SYSCONFDIR@/local.d"
ewarn "to executable scripts with an .start extension"
ewarn "in \"@SYSCONFDIR@/local.d\""
local_start
fi
eend 0
eend ${has_errors}
# We have to end with a zero exit code, because a failed execution
# of an executable @SYSCONFDIR@/local.d/*.start file shouldn't result in
# marking the local service as failed. Otherwise we are unable to
# execute any executable @SYSCONFDIR@/local.d/*.stop file, because a failed
# marked service cannot be stopped (and the stop function would
# actually call the executable @SYSCONFDIR@/local.d/*.stop file(s)).
return 0
}
stop()
{
einfo "Stopping local"
ebegin "Stopping local"
local file
local file has_errors=0 retval
eindent
for file in @SYSCONFDIR@/local.d/*.stop; do
[ -x "$file" ] && "$file"
if [ -x "${file}" ]; then
vebegin "Executing \"${file}\""
"${file}" 2>&1 >/dev/null
retval=$?
if [ ${retval} -ne 0 ]; then
has_errors=1
fi
veend ${retval} "Execution of \"${file}\" failed."
fi
done
eoutdent
if type local_start >/dev/null 2>&1; then
ewarn "@SYSCONFDIR@/conf.d/local should be removed."
if command -v local_stop >/dev/null 2>&1; then
ewarn "\"@SYSCONFDIR@/conf.d/local\" should be removed."
ewarn "Please move the code from the local_stop function"
ewarn "to scripts with an .stop extension"
ewarn "in @SYSCONFDIR@/local.d"
ewarn "to executable scripts with an .stop extension"
ewarn "in \"@SYSCONFDIR@/local.d\""
local_stop
fi
eend 0
eend ${has_errors}
# An executable @SYSCONFDIR@/local.d/*.stop file which failed with a
# non-zero exit status is not a reason to mark this service
# as failed, therefore we have to end with a zero exit code.
return 0
}

View File

@@ -1,4 +1,4 @@
#!@SBINDIR@/runscript
#!@SBINDIR@/openrc-run
# Copyright (c) 2007-2009 Roy Marples <roy@marples.name>
# Released under the 2-clause BSD license.
@@ -59,10 +59,35 @@ stop()
no_umounts_r="^($no_umounts_r)$"
# Flush all pending disk writes now
sync; sync
sync
. "$RC_LIBEXECDIR"/sh/rc-mount.sh
if [ "$RC_UNAME" = Linux ] && [ -d /sys/fs/aufs ] ; then
#if / is aufs we remount it noxino during shutdown
if mountinfo -q -f '^aufs$' / ; then
mount -o remount,noxino,rw /
sync
fi
local aufs_branch aufs_mount_dir aufs_mount_point aufs_si_dir aufs_si_id
for aufs_si_dir in /sys/fs/aufs/*; do
aufs_mount_dir=${aufs_si_dir#/sys/fs/aufs/}
aufs_si_id="$(printf "%s" $aufs_mount_dir | sed 's/_/=/g')"
aufs_mount_point="$(mountinfo -o ${aufs_si_id})"
for x in $aufs_si_dir/br[0-9][0-9][0-9]; do
aufs_branch=$(sed 's/=.*//g' $x)
eindent
if ! mount -o "remount,del:$aufs_branch" "$aufs_mount_point" > /dev/null 2>&1; then
ewarn "Failed to remove branch $aufs_branch from aufs \
$aufs_mount_point"
fi
eoutdent
sync
done
done
fi
# Umount loop devices
einfo "Unmounting loop devices"
eindent

View File

@@ -1,4 +1,4 @@
#!@SBINDIR@/runscript
#!@SBINDIR@/openrc-run
# Copyright (c) 2013 William Hubbs <w.d.hubbs@gmail.com>
# Released under the 2-clause BSD license.
@@ -13,7 +13,7 @@ start()
{
if [ "$RC_UNAME" = Linux ]; then
ebegin "Bringing up network interface lo"
if type ip > /dev/null 2>&1; then
if command -v ip > /dev/null 2>&1; then
ip addr add 127.0.0.1/8 dev lo brd + scope host
ip route add 127.0.0.0/8 dev lo scope host
ip link set lo up

View File

@@ -1,4 +1,4 @@
#!@SBINDIR@/runscript
#!@SBINDIR@/openrc-run
# Copyright (c) 2007-2008 Roy Marples <roy@marples.name>
# Released under the 2-clause BSD license.

View File

@@ -1,4 +1,4 @@
#!@SBINDIR@/runscript
#!@SBINDIR@/openrc-run
# Copyright (c) 2007-2009 Roy Marples <roy@marples.name>
# Released under the 2-clause BSD license.

View File

@@ -1,4 +1,4 @@
#!@SBINDIR@/runscript
#!@SBINDIR@/openrc-run
# Copyright (c) 2007-2009 Roy Marples <roy@marples.name>
# Released under the 2-clause BSD license.
@@ -15,7 +15,7 @@ start()
local ret=0
# Flush all pending disk writes now
sync; sync
sync
ebegin "Remounting remaining filesystems read-only"
# We need the do_unmount function

View File

@@ -1,4 +1,4 @@
#!@SBINDIR@/runscript
#!@SBINDIR@/openrc-run
# Copyright (c) 2007-2009 Roy Marples <roy@marples.name>
# Released under the 2-clause BSD license.

View File

@@ -1,4 +1,4 @@
#!@SBINDIR@/runscript
#!@SBINDIR@/openrc-run
# Copyright (c) 2007-2008 Roy Marples <roy@marples.name>
# Released under the 2-clause BSD license.
@@ -12,13 +12,16 @@ depend()
start()
{
if [ -L /etc/mtab ]
then
einfo "Skipping mtab update (mtab is a symbolic link)"
if [ -L /etc/mtab ]; then
return 0
fi
ebegin "Updating /etc/mtab"
vewarn "The support for updating /etc/mtab as a file is"
vewarn "deprecated and will be removed in the future."
vewarn "Please run the following command as root on your system."
vewarn
vewarn "ln -snf /proc/self/mounts /etc/mtab"
if ! echo 2>/dev/null >/etc/mtab; then
ewend 1 "/etc/mtab is not updateable"
return 0

View File

@@ -1,11 +1,8 @@
#!@SBINDIR@/runscript
#!@SBINDIR@/openrc-run
# Copyright (c) 2007-2009 Roy Marples <roy@marples.name>
# Released under the 2-clause BSD license.
description="Mounts network shares, other than NFS, according to /etc/fstab."
# We skip all NFS shares in this script because they require extra
# daemons to be running on the client in order to work correctly.
# It is best to allow nfs-utils to handle all nfs shares.
description="Mounts network shares according to /etc/fstab."
depend()
{
@@ -19,11 +16,6 @@ start()
{
local x= fs= rc=
for x in $net_fs_list $extra_net_fs_list; do
case "$x" in
nfs|nfs4)
continue
;;
esac
fs="$fs${fs:+,}$x"
done
@@ -46,14 +38,7 @@ stop()
. "$RC_LIBEXECDIR"/sh/rc-mount.sh
for x in $net_fs_list $extra_net_fs_list; do
case "$x" in
nfs|nfs4)
continue
;;
*)
fs="$fs${fs:+,}$x"
;;
esac
fs="$fs${fs:+,}$x"
done
if [ -n "$fs" ]; then
umount -at $fs || eerror "Failed to simply unmount filesystems"

View File

@@ -1,4 +1,4 @@
#!@SBINDIR@/runscript
#!@SBINDIR@/openrc-run
# Copyright (c) 2009 Roy Marples <roy@marples.name>
# Released under the 2-clause BSD license.
@@ -46,7 +46,11 @@ sys_interfaces()
local w= rest= i= cmd=$1
while read w rest; do
i=${w%%:*}
[ "$i" != "$w" ] || continue
case "$i" in
"$w") continue ;;
lo|lo0) continue ;;
*) ;;
esac
if [ "$cmd" = u ]; then
ifconfig "$i" | grep -q "[ ]*UP" || continue
fi

View File

@@ -1,4 +1,4 @@
#!@SBINDIR@/runscript
#!@SBINDIR@/openrc-run
# Copyright (c) 2007-2009 Roy Marples <roy@marples.name>
# Released under the 2-clause BSD license.

View File

@@ -1,4 +1,4 @@
#!@SBINDIR@/runscript
#!@SBINDIR@/openrc-run
# Copyright (c) 2007-2008 Roy Marples <roy@marples.name>
# Released under the 2-clause BSD license.

View File

@@ -1,4 +1,4 @@
#!@SBINDIR@/runscript
#!@SBINDIR@/openrc-run
# Copyright (c) 2007-2009 Roy Marples <roy@marples.name>
# Released under the 2-clause BSD license.

View File

@@ -1,4 +1,4 @@
#!@SBINDIR@/runscript
#!@SBINDIR@/openrc-run
# Copyright (c) 2007-2009 Roy Marples <roy@marples.name>
# Released under the 2-clause BSD license.
@@ -17,7 +17,7 @@ depend() {
start()
{
ebegin "Starting $name"
if type kldload >/dev/null 2>&1; then
if command -v kldload >/dev/null 2>&1; then
kldload pf 2>/dev/null
fi
pfctl -q -F all

View File

@@ -1,4 +1,4 @@
#!@SBINDIR@/runscript
#!@SBINDIR@/openrc-run
# Copyright (c) 2007-2009 Roy Marples <roy@marples.name>
# Released under the 2-clause BSD license.

View File

@@ -1,4 +1,4 @@
#!@SBINDIR@/runscript
#!@SBINDIR@/openrc-run
# Copyright (c) 2007-2009 Roy Marples <roy@marples.name>
# Released under the 2-clause BSD license.
@@ -61,10 +61,10 @@ start()
fi
# Setup Kernel Support for SELinux
if [ -d /selinux ] && ! mountinfo -q /selinux; then
if [ -d /sys/fs/selinux ] && ! mountinfo -q /sys/fs/selinux; then
if grep -qs selinuxfs /proc/filesystems; then
ebegin "Mounting SELinux filesystem"
mount -t selinuxfs selinuxfs /selinux
mount -t selinuxfs selinuxfs /sys/fs/selinux
eend $?
fi
fi

View File

@@ -1,4 +1,4 @@
#!@SBINDIR@/runscript
#!@SBINDIR@/openrc-run
# Copyright (c) 2007-2008 Roy Marples <roy@marples.name>
# Released under the 2-clause BSD license.

View File

@@ -1,4 +1,4 @@
#!@SBINDIR@/runscript
#!@SBINDIR@/openrc-run
# Copyright (c) 2007-2009 Roy Marples <roy@marples.name>
# Released under the 2-clause BSD license.

View File

@@ -1,4 +1,4 @@
#!@SBINDIR@/runscript
#!@SBINDIR@/openrc-run
# Copyright (c) 2007-2009 Roy Marples <roy@marples.name>
# Released under the 2-clause BSD license.

View File

@@ -1,4 +1,4 @@
#!@SBINDIR@/runscript
#!@SBINDIR@/openrc-run
# Copyright (c) 2007-2009 Roy Marples <roy@marples.name>
# Released under the 2-clause BSD license.

View File

@@ -1,4 +1,4 @@
#!@SBINDIR@/runscript
#!@SBINDIR@/openrc-run
# Copyright (c) 2007-2009 Roy Marples <roy@marples.name>
# Released under the 2-clause BSD license.
@@ -13,8 +13,8 @@ start()
return 1
fi
fi
if ! checkpath -W "$RC_LIBEXECDIR"; then
ewarn "WARNING: ${RC_LIBEXECDIR} is not writable!"
if ! checkpath -W "$RC_LIBEXECDIR"/cache; then
ewarn "WARNING: ${RC_LIBEXECDIR}/cache is not writable!"
if ! yesno "${RC_GOINGDOWN}"; then
ewarn "Unable to save deptree cache"
return 1

View File

@@ -1,4 +1,4 @@
#!@SBINDIR@/runscript
#!@SBINDIR@/openrc-run
# Copyright (c) 2007-2009 Roy Marples <roy@marples.name>
# Released under the 2-clause BSD license.

View File

@@ -1,4 +1,4 @@
#!@SBINDIR@/runscript
#!@SBINDIR@/openrc-run
# Copyright (c) 2009 Roy Marples <roy@marples.name>
# Released under the 2-clause BSD license.

View File

@@ -1,4 +1,4 @@
#!@SBINDIR@/runscript
#!@SBINDIR@/openrc-run
# Copyright (c) 2007-2008 Roy Marples <roy@marples.name>
# Released under the 2-clause BSD license.

View File

@@ -1,4 +1,4 @@
#!@SBINDIR@/runscript
#!@SBINDIR@/openrc-run
# Copyright (c) 2007-2009 Roy Marples <roy@marples.name>
# Released under the 2-clause BSD license.

View File

@@ -1,4 +1,4 @@
#!@SBINDIR@/runscript
#!@SBINDIR@/openrc-run
# Copyright (c) 2007-2009 Roy Marples <roy@marples.name>
# Released under the 2-clause BSD license.

View File

@@ -1,4 +1,4 @@
#!@SBINDIR@/runscript
#!@SBINDIR@/openrc-run
# Copyright (c) 2009 Roy Marples <roy@marples.name>
# Released under the 2-clause BSD license.
@@ -17,7 +17,7 @@ start()
{
ebegin "Setting the local clock based on last shutdown time"
if ! swclock 2> /dev/null; then
swclock --warn @SBINDIR@/runscript
swclock --warn @SBINDIR@/openrc-run
fi
eend $?
}

View File

@@ -1,4 +1,4 @@
#!@SBINDIR@/runscript
#!@SBINDIR@/openrc-run
# Copyright (c) 2007-2009 Roy Marples <roy@marples.name>
# Released under the 2-clause BSD license.

View File

@@ -1,4 +1,4 @@
#!@SBINDIR@/runscript
#!@SBINDIR@/openrc-run
# Copyright (c) 2007-2009 Roy Marples <roy@marples.name>
# Released under the 2-clause BSD license.

View File

@@ -0,0 +1,31 @@
#!@SBINDIR@/openrc-run
# Copyright (c) 2007-2009 Roy Marples <roy@marples.name>
# Released under the 2-clause BSD license.
depend()
{
before bootmisc logger
keyword -prefix
}
start()
{
[ -e /etc/sysctl.conf ] || return 0
local retval=0 var= comments= conf=
ebegin "Configuring kernel parameters"
eindent
for conf in @SYSCONFDIR@/sysctl.conf @SYSCONFDIR@/sysctl.d/*.conf; do
if [ -r "$conf" ]; then
vebegin "applying $conf"
while read var comments; do
case "$var" in
""|"#"*) continue;;
esac
sysctl -w "$var" >/dev/null || retval=1
done < "$conf"
veend $retval
fi
done
eoutdent
eend $retval "Some errors were encountered"
}

32
init.d/sysctl.GNU.in Normal file
View File

@@ -0,0 +1,32 @@
#!@PREFIX@/sbin/runscript
# Copyright (c) 2007-2009 Roy Marples <roy@marples.name>
# Released under the 2-clause BSD license.
#FIXME: Modify for GNU/Hurd
depend()
{
before bootmisc logger
keyword -prefix
}
start()
{
[ -e /etc/sysctl.conf ] || return 0
local retval=0 var= comments= conf=
ebegin "Configuring kernel parameters"
eindent
for conf in @SYSCONFDIR@/sysctl.conf @SYSCONFDIR@/sysctl.d/*.conf; do
if [ -r "$conf" ]; then
vebegin "applying $conf"
while read var comments; do
case "$var" in
""|"#"*) continue;;
esac
sysctl -w "$var" >/dev/null || retval=1
done < "$conf"
veend $retval
fi
done
eoutdent
eend $retval "Some errors were encountered"
}

View File

@@ -1,34 +1,16 @@
#!@SBINDIR@/runscript
#!@SBINDIR@/openrc-run
# Copyright (c) 2007-2008 Roy Marples <roy@marples.name>
# Released under the 2-clause BSD license.
depend()
{
before bootmisc logger
keyword -lxc -prefix -vserver
keyword -prefix -vserver
}
start()
{
local conf= retval=0 err errs
ebegin "Configuring kernel parameters"
eindent
for conf in @SYSCONFDIR@/sysctl.conf @SYSCONFDIR@/sysctl.d/*.conf; do
if [ -r "$conf" ]; then
vebegin "applying $conf"
if ! err=$(sysctl -p "$conf" 2>&1 >/dev/null) ; then
errs="${errs} ${err}"
sysctl -e -p "${conf}" >/dev/null
fi
veend $? || retval=1
fi
done
eoutdent
if [ ${retval} -eq 0 ] && [ -n "${errs}" ] ; then
ewarn "Unknown keys:${errs}"
fi
eend $retval "Some errors were encountered: ${errs}"
sysctl --system
eend $? "Unable to configure some kernel parameters"
}

View File

@@ -1,4 +1,4 @@
#!@SBINDIR@/runscript
#!@SBINDIR@/openrc-run
# Copyright (c) 2007-2009 Roy Marples <roy@marples.name>
# Released under the 2-clause BSD license.
@@ -99,14 +99,16 @@ mount_misc()
mount_cgroups()
{
mountinfo -q /sys/fs/cgroup || return 0
mountinfo -q /sys/fs/cgroup || return 0
local agent="@LIBEXECDIR@/sh/cgroup-release-agent.sh"
mkdir /sys/fs/cgroup/openrc
mount -n -t cgroup \
-o none,${sysfs_opts},name=openrc,release_agent="$agent" \
openrc /sys/fs/cgroup/openrc
echo 1 > /sys/fs/cgroup/openrc/notify_on_release
if ! mountinfo -q /sys/fs/cgroup/openrc; then
local agent="@LIBEXECDIR@/sh/cgroup-release-agent.sh"
mkdir /sys/fs/cgroup/openrc
mount -n -t cgroup \
-o none,${sysfs_opts},name=openrc,release_agent="$agent" \
openrc /sys/fs/cgroup/openrc
echo 1 > /sys/fs/cgroup/openrc/notify_on_release
fi
yesno ${rc_controller_cgroups:-YES} && [ -e /proc/cgroups ] || return 0
while read name hier groups enabled rest; do
@@ -119,6 +121,18 @@ mount_cgroups()
done < /proc/cgroups
}
restorecon_sys()
{
if [ -x /sbin/restorecon ]; then
ebegin "Restoring SELinux contexts in /sys"
restorecon -F /sys/devices/system/cpu/online >/dev/null 2>&1
restorecon -rF /sys/fs/cgroup >/dev/null 2>&1
eend $?
fi
return 0
}
start()
{
local retval
@@ -132,5 +146,8 @@ start()
mount_cgroups
retval=$?
fi
restorecon_sys
return $retval
}

View File

@@ -1,4 +1,4 @@
#!@SBINDIR@/runscript
#!@SBINDIR@/openrc-run
# Copyright (c) 2007-2009 Roy Marples <roy@marples.name>
# Released under the 2-clause BSD license.

View File

@@ -1,4 +1,4 @@
#!@SBINDIR@/runscript
#!@SBINDIR@/openrc-run
# Copyright (c) 2008-2009 Roy Marples <roy@marples.name>
# Released under the 2-clause BSD license.

View File

@@ -1,4 +1,4 @@
#!@SBINDIR@/runscript
#!@SBINDIR@/openrc-run
# Copyright 1999-2012 Gentoo Foundation
# Released under the 2-clause BSD license.
@@ -14,8 +14,7 @@ depend()
start()
{
ebegin "setting up tmpfiles.d entries for /dev"
@LIBEXECDIR@/sh/tmpfiles.sh --prefix=/dev --create --remove \
${tmpfiles_opts}
@LIBEXECDIR@/sh/tmpfiles.sh --prefix=/dev --create ${tmpfiles_opts}
eend $?
return 0
}

View File

@@ -1,4 +1,4 @@
#!@SBINDIR@/runscript
#!@SBINDIR@/openrc-run
# Copyright 1999-2012 Gentoo Foundation
# Released under the 2-clause BSD license.
@@ -12,7 +12,7 @@ depend()
start()
{
ebegin "setting up tmpfiles.d entries"
@LIBEXECDIR@/sh/tmpfiles.sh --exclude-prefix=/dev --create --remove \
@LIBEXECDIR@/sh/tmpfiles.sh --exclude-prefix=/dev --create --remove --boot \
${tmpfiles_opts}
eend $?
return 0

View File

@@ -1,4 +1,4 @@
#!@SBINDIR@/runscript
#!@SBINDIR@/openrc-run
# Copyright (c) 2008 Roy Marples <roy@marples.name>
# Released under the 2-clause BSD license.

View File

@@ -1,4 +1,4 @@
#!@SBINDIR@/runscript
#!@SBINDIR@/openrc-run
# Copyright (c) 2007-2009 Roy Marples <roy@marples.name>
# Released under the 2-clause BSD license.

View File

@@ -1,4 +1,4 @@
#!@SBINDIR@/runscript
#!@SBINDIR@/openrc-run
# Copyright (c) 2008-2009 Roy Marples <roy@marples.name>
# Released under the 2-clause BSD license.

View File

@@ -1,7 +1,7 @@
MAN3= einfo.3 \
rc_config.3 rc_deptree.3 rc_find_pids.3 rc_plugin_hook.3 \
rc_runlevel.3 rc_service.3 rc_stringlist.3
MAN8= rc-service.8 rc-status.8 rc-update.8 rc.8 runscript.8 \
MAN8= rc-service.8 rc-status.8 rc-update.8 openrc.8 openrc-run.8 \
service.8 start-stop-daemon.8
# Handy macro to create symlinks

View File

@@ -105,7 +105,8 @@ and
respectively, but only work when
.Va EINFO_VERBOSE
is true. You can also make the
.Fn einfo
.Fn einfo ,
.Fn ewarn ,
and
.Fn ebegin
functions silent by setting
@@ -184,6 +185,12 @@ when set to true makes the
and
.Fn einfon
family of functions quiet, so nothing is printed.
.Va EERROR_QUIET
when set to true makes the
.Fn eerror
and
.Fn eerrorn
family of functions quiet, so nothing is printed.
.Pp
.Va EINFO_VERBOSE
when set to true makes the

View File

@@ -22,10 +22,10 @@
.\" SUCH DAMAGE.
.\"
.Dd December 31, 2011
.Dt RUNSCRIPT 8 SMM
.Dt openrc-run 8 SMM
.Os OpenRC
.Sh NAME
.Nm runscript
.Nm openrc-run
.Nd a means of hooking shell commands into a service
.Sh SYNOPSIS
.Nm
@@ -47,7 +47,7 @@ and finally the script itself. At this point
then runs the command given.
.Pp
Commands are defined as shell functions within the script. Here is a list of
some functions that all runscripts have by default:
some functions that all scripts have by default:
.Bl -tag -width "RC_DEFAULTLEVEL"
.It Ar describe
Describes what the service does and each command the service defines.
@@ -60,12 +60,12 @@ First we ensure that any services that depend on us are stopped. If any
services that need us fail to stop then we exit with a suitable error,
otherwise call the supplied stop function if it exists.
.It Ar restart
Stop and start the service, including dependencies. This cannot be
Stops and starts the service, including dependencies. This cannot be
overridden. See the description of the RC_CMD variable below for the
method to make your service behave differently when restart is being
executed.
.It Ar status
Show the status of the service. The return code matches the status, with the
Shows the status of the service. The return code matches the status, with the
exception of "started" returning 0 to match standard command behaviour.
.It Ar zap
Resets the service state to stopped and removes all saved data about the
@@ -88,8 +88,8 @@ Output from any non OpenRC commands is not affected.
.It Fl v , -verbose
Turns on any extra informational output the service generates.
.It Fl Z , -dry-run
Shows what services would be stopped and/or started without actually starting
or stopping them.
Shows which services would be stopped and/or started without actually stopping
or starting them.
.El
.Pp
The following variables affect the service script:
@@ -120,6 +120,9 @@ Set this to "true", "yes" or "1" (case-insensitive) to force the daemon into
the background. This implies the "--make-pidfile" and "--pidfile" option of
.Xr start-stop-daemon 8
so the pidfile variable must be set.
.It Ar chroot
.Xr start-stop-daemon 8
will chroot into this path before writing the pid file or starting the daemon.
.It Ar pidfile
Pidfile to use for the above defined command.
.It Ar name
@@ -131,6 +134,12 @@ timeout in seconds or multiple signal/timeout pairs (like SIGTERM/5).
A list of directories which must exist for the service to start.
.It Ar required_files
A list of files which must exist for the service to start.
.It Ar start_inactive
Set to yes to have the service marked inactive when it starts. This is
used along with in_background_fake to support re-entrant services.
.It Ar in_background_fake
Space separated list of commands which should always succeed when
in_background is yes.
.El
.Sh DEPENDENCIES
You should define a
@@ -321,16 +330,36 @@ Mark the service as inactive.
.Op Fl f , -file
.Op Fl p , -pipe
.Op Fl m , -mode Ar mode
.Op Fl o , owner Ar owner
.Op Fl o , -owner Ar owner
.Op Fl W , -writable
.Op Fl q , -quiet
.Ar path ...
.Xc
Checks to see if the path exists, is of the right type, owned by the right
people and has the correct access modes. If not, then it corrects the path.
.It Ic checkpath
.Op Fl W , -writable
.Ar path
.Xc
checks to see if the path is writable.
If -d, -f or -p is specified, checkpath checks to see if the path
exists, is the right type and has the correct owner and access modes. If
any of these tests fail, the path is created and set up as specified. If
more than one of -d, -f or -p are specified, the last one will be used.
The argument to -m is a three or four digit octal number. If this option
is not provided, the value defaults to 0644 for files and 0775 for
directories.
The argument to -o is a representation of the user and/or group which
should own the path. The user and group can be represented numerically
or with names, and are separated by a colon.
The truncate options (-D and -F) cause the directory or file to be
cleared of all contents.
If -W is specified, checkpath checks to see if the first path given on
the command line is writable. This is different from how the test
command in the shell works, because it also checks to make sure the file
system is not read only.
Also, the -d, -f or -p options should not be specified along with this option.
The -q option suppresses all informational output. If it is specified
twice, all error messages are suppressed as well.
.It Ic yesno Ar value
If
.Ar value
@@ -342,8 +371,10 @@ sets the following environment variables for use in the service scripts:
.Bl -tag -width "RC_DEFAULTLEVEL"
.It Va RC_SVCNAME
Name of the service.
.It Va RC_SERVICE
Full path to the service.
.It Va RC_RUNLEVEL
Current runlevel that rc is in. Note that, in OpenRC, the reboot
Current runlevel that OpenRC is in. Note that, in OpenRC, the reboot
runlevel is mapped to the shutdown runlevel. This was done because most
services do not need to know if a system is shutting down or rebooting.
If you are writing a service that does need to know this, see the
@@ -367,6 +398,15 @@ The result of `uname -s`.
This contains the name of the command the service script is executing, such
as start, stop, restart etc. One example of using this is to make a
service script behave differently when restart is being executed.
.It Va RC_GOINGDOWN
This variable contains YES if the system is going into single user mode
or shutting down.
.It Va RC_LIBEXECDIR
The value of libexecdir which OpenRC was configured with during build
time.
.It Va RC_NO_UMOUNTS
This variable is used by plugins to contain a list of directories which
should not be unmounted.
.El
.Sh FILES
.Pp
@@ -411,7 +451,7 @@ rc_keyword="!-prefix"
.Pp
An example service script for foo.
.Bd -literal -offset indent
#!/sbin/runscript
#!/sbin/openrc-run
command=/usr/bin/foo
command_args="${foo_args} --bar"
pidfile=/var/run/foo.pid
@@ -471,7 +511,7 @@ start_pre()
# stop_post.
fi
# Ensure that our dirs are correct
checkpath --dir --owner foo:foo --mode 0664 \\
checkpath --directory --owner foo:foo --mode 0775 \\
/var/run/foo /var/cache/foo
}
@@ -536,7 +576,7 @@ Instead we return 1 to be compliant with Gentoo baselayout.
Users are encouraged to use the is_newer_than function which returns correctly.
.Sh SEE ALSO
.Xr einfo 3 ,
.Xr rc 8 ,
.Xr openrc 8 ,
.Xr rc-status 8 ,
.Xr rc-update 8 ,
.Xr rc_plugin_hook 3 ,

View File

@@ -22,10 +22,10 @@
.\" SUCH DAMAGE.
.\"
.Dd May 2, 2009
.Dt RC 8 SMM
.Dt OPENRC 8 SMM
.Os OpenRC
.Sh NAME
.Nm rc
.Nm openrc
.Nd stops and starts services for the specified runlevel
.Sh SYNOPSIS
.Nm

View File

@@ -63,7 +63,7 @@ otherwise -1.
.Fl r , -resolve
does the same and also prints the full path of the service to stdout.
.Sh SEE ALSO
.Xr rc 8 ,
.Xr openrc 8 ,
.Xr stdout 3
.Sh AUTHORS
.An Roy Marples <roy@marples.name>

View File

@@ -66,7 +66,7 @@ exits 0, except when checking for crashed services and it doesn't find any.
tries to list services within each runlevel in the presently resolved
dependency order if the dependency tree is available.
.Sh SEE ALSO
.Xr rc 8 ,
.Xr openrc 8 ,
.Xr rc-update 8
.Sh AUTHORS
.An Roy Marples <roy@marples.name>

View File

@@ -21,7 +21,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.Dd May 2, 2009
.Dd Jan 13, 2014
.Dt RC-UPDATE 8 SMM
.Os OpenRC
.Sh NAME
@@ -35,6 +35,7 @@
.Op Ar runlevel ...
.Nm
.Op Fl s , -stack
.Op Fl a , -all
.Ar delete
.Ar service
.Op Ar runlevel ...
@@ -53,7 +54,8 @@ All services must reside in the
or
.Pa /usr/local/etc/init.d
directories.
They must also conform to the OpenRC runscript standard.
They must also be standard OpenRC scripts, meaning they must use
openrc-run.
.Pp
.Bl -tag -width "Fl a , -delete service"
.It Ar add Ar service
@@ -85,8 +87,16 @@ If the
.Fl s , -stack
option is given then we either add or remove the runlevel from the runlevel.
This allows inheritance of runlevels.
If the
.Fl a, -all
option is given, we remove the service from all runlevels. This is
useful, for example, to clean up the dangling symlinks after a service
is removed.
.Sh SEE ALSO
.Xr rc 8 ,
.Xr openrc 8 ,
.Xr openrc-run 8 ,
.Xr rc-status 8
.Sh AUTHORS
.An Roy Marples <roy@marples.name>
.An The OpenRC Team <openrc@gentoo.org>

View File

@@ -107,6 +107,6 @@ when done.
.Xr malloc 3 ,
.Xr free 3 ,
.Xr rc_stringlist_free 3 ,
.Xr runscript 8
.Xr openrc-run 8
.Sh AUTHORS
.An Roy Marples <roy@marples.name>

View File

@@ -44,7 +44,7 @@ is set to the name of the runlevel or name of the service.
Plugins can affect the parent environment by writing NULL separated strings to
.Va rc_environ_fd .
.Sh SEE ALSO
.Xr rc 8 ,
.Xr runscript 8
.Xr openrc 8 ,
.Xr openrc-run 8
.Sh AUTHORS
.An Roy Marples <roy@marples.name>

View File

@@ -141,7 +141,7 @@ is lost.
returns a list of extra commands the
.Fa service
supports beyond the default ones. See
.Nm runscript
.Nm openrc-run
for default commands.
.Pp
.Fn rc_service_plugable

View File

@@ -139,7 +139,7 @@ option.
Modifies the IO scheduling priority of the daemon.
Class can be 0 for none, 1 for real time, 2 for best effort and 3 for idle.
Data can be from 0 to 7 inclusive.
.It Fl N , -nice Ar level
.It Fl N , -nicelevel Ar level
Modifies the scheduling priority of the daemon.
.It Fl 1 , -stdout Ar logfile
Redirect the standard output of the process to logfile when started with

View File

@@ -3,7 +3,9 @@
# Generic definitions
SFX= .GNU-kFreeBSD.in
PKG_PREFIX?= /usr
CPPFLAGS+= -D_BSD_SOURCE -D_XOPEN_SOURCE=700
LIBDL= -Wl,-Bdynamic -ldl
LIBKVM?=
include ${MK}/os-BSD.mk

8
mk/os-GNU.mk Normal file
View File

@@ -0,0 +1,8 @@
# Copyright (c) 2008 Roy Marples <roy@marples.name>
# Released under the 2-clause BSD license.
SFX= .GNU.in
PKG_PREFIX?= /usr
CPPFLAGS+= -D_BSD_SOURCE -D_XOPEN_SOURCE=700 -DMAXPATHLEN=4096 -DMAX_PATH=4096
LIBDL= -Wl,-Bdynamic -ldl

View File

@@ -6,3 +6,9 @@ PKG_PREFIX?= /usr
CPPFLAGS+= -D_BSD_SOURCE -D_XOPEN_SOURCE=700
LIBDL= -Wl,-Bdynamic -ldl
ifeq (${MKSELINUX},yes)
CPPFLAGS+= -DHAVE_SELINUX
LIBSELINUX= -lselinux
LDADD += $(LIBSELINUX)
endif

View File

@@ -1,11 +1,12 @@
ifeq (${MKTERMCAP},ncurses)
LTERMCAP:= $(shell pkg-config ncurses --libs 2> /dev/null)
TERMCAP_CFLAGS:= $(shell pkg-config ncurses --cflags 2> /dev/null)
LTERMCAP:= $(shell pkg-config ncurses --libs 2> /dev/null)
ifeq ($(LTERMCAP),)
LIBTERMCAP?= -lncurses
else
LIBTERMCAP?= $(LTERMCAP)
endif
CPPFLAGS+= -DHAVE_TERMCAP
CPPFLAGS+= -DHAVE_TERMCAP ${TERMCAP_CFLAGS}
LDADD+= ${LIBTERMCAP}
else ifeq (${MKTERMCAP},termcap)
LIBTERMCAP?= -ltermcap

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