Commit Graph
100 Commits
Author SHA1 Message Date
William Hubbs ca0270967c tools/meson_final.sh: typo fix 2021-09-06 18:37:11 -05:00
William Hubbs 3a187f88f4 build: typo fix 2021-09-06 16:04:46 -05:00
William Hubbs f2362cc277 build: add split-usr option 2021-09-06 15:22:28 -05:00
William Hubbs 444e44eb9d build: change root_prefix to rootprefix 2021-09-06 14:30:30 -05:00
William Hubbs c0f8313164 sync meson build version with makefiles 2021-09-05 20:04:55 -05:00
William Hubbs d6622a1156 add meson build files
Closes #116.
Closes #171.
Closes #172.
Closes #175.
2021-09-04 16:01:29 -05:00
William Hubbs 92004a2ed6 README: add note about github discussions 2021-09-04 14:23:18 -05:00
William Hubbs 7cedc4942b update travis ci irc notifications
- move to libera network
- always notify on successful build
2021-08-14 15:05:07 -05:00
William Hubbs 091cd8015f man/supervise-daemon.8: document --pidfile option 2021-08-13 23:08:07 -05:00
William Hubbs b5e4c2c2db Revert "openrc-init: ignore an empty string in argv[1]"
This reverts commit dec9ef200b.
This check is no longer needed since rc_runlevel_exists() is fixed.

    X-Gentoo-Bug: 803536
    X-Gentoo-Bug-URL: https://bugs.gentoo.org/803536
    Closes: https://github.com/OpenRC/openrc/pull/431
2021-08-13 10:46:57 -05:00
William Hubbs 0a97bad6c9 librc: fix rc_runlevel_exists return for empty string
This function should return false if the runlevel is an empty string.

    X-Gentoo-Bug: 803536
    X-Gentoo-Bug-URL: https://bugs.gentoo.org/803536
    Closes: https://github.com/OpenRC/openrc/pull/431
2021-08-13 10:28:44 -05:00
William Hubbs 7f47539fb1 sh/rc-cgroup.sh: fix case in starting message
X-Gentoo-Bug: 804193
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=804193
2021-08-12 14:23:34 -05:00
William Hubbs 9c7bedca9e sh/rc-cgroup.sh: fix cgroup_cleanup
X-Gentoo-Bug: 804193
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=804193
2021-08-12 14:21:58 -05:00
William Hubbs 1d282ddc80 move the irc channel to the libera network 2021-05-23 16:45:32 -05:00
William Hubbs 791322d7fa checkpath: fix code to walk the directory path
X-Gentoo-Bug: 782808
X-Gentoo-Bug-URL: https://bugs.gentoo.org/782808
2021-04-15 17:40:00 -05:00
William Hubbs 63db2d99e7 checkpath: remove extra slashes from paths
This fixes #418.
2021-04-13 17:13:25 -05:00
William Hubbs 8400e7d302 style fix 2021-04-13 16:29:21 -05:00
William Hubbs 533a8c70b3 cgroup2_set_limits: fix harmless error message
In legacy cgroups mode, we were running `mountinfo -q ""` which was
generating an error message. If we return immediately when
cgroup2_find_path returns an empty value, we avoid this message.
2021-04-04 17:31:49 -05:00
William Hubbs 852a3c86f6 NEWNET.md: fix the title 2021-04-03 15:18:30 -05:00
William Hubbs b3e8072403 rename README.newnet to a markdown file
All of our documentation is in markdown, so rename this file to be
consistent.
2021-04-03 15:14:35 -05:00
William Hubbs b7c03dea27 README: convert references to markdown links 2021-04-03 15:13:09 -05:00
William Hubbs ee05403c50 version 0.43 2021-04-02 12:47:39 -05:00
William Hubbs c1558abb0f update ChangeLog 2021-04-02 12:43:37 -05:00
William Hubbs 901b752463 README: force references to be on separate lines for github 2021-04-02 12:35:29 -05:00
William Hubbs c88368b792 update news
This adds a note about SHLIBDIR being dropped from the makefiles.
2021-04-02 11:37:35 -05:00
William Hubbs bfffe2c585 drop reference to gentoo bugzilla
OpenRC has a bug tracker on github, so ask people to file issues there.
2021-03-29 12:55:04 -05:00
William Hubbs 5f890ee8ab init.sh: rework the /run setup for linux xystems
- fix mount options for /run.
- run restorecon after everything is set up.

X-Gentoo-Bug: 740576
X-Gentoo-Bug-URL: https://bugs.gentoo.org/740576
2021-03-22 15:47:21 -05:00
William Hubbs ef76a663bc stop namespaced services with specified pids
The previous fix excludes PIDs of processes running in a different namespace
regardless of whether the PID has been explicitly stored in a PID file mentioned
in the --pidfile parameter.  The correct behavior is to only exclude the pid if
it is not stored in a pidfile.

X-Gentoo-Bug: 776010
X-Gentoo-Bug-URL: https://bugs.gentoo.org/776010
2021-03-22 11:34:41 -05:00
William Hubbs fccd37c34c add PKGCONFIGDIR to the makefiles
This allows pkgconfig files to be stored in /usr even if PREFIX is /.
2021-03-21 17:41:58 -05:00
William Hubbs 5058b6668c drop shlibdir
I know of no other build systems that have separate paths for static vs
shared libraries, so this changes ours to use libdir for all libraries.
2021-03-21 17:20:25 -05:00
William Hubbs 08d518b7fe rc_cgroup.sh: do not add newline when writing group2 values
Fixes: #407
2021-03-15 16:59:43 -05:00
William Hubbs de77674663 rc-cgroup.sh: avoid process substitution for cgroup_get_pids
This should make cgroup_cleanup work successfully since cgroup_get_pids
no longer uses a subshell.

This fixes #396.
This fixes #397.
2021-03-01 14:21:24 -06:00
William Hubbs 4fb4674374 fix unified cgroups v2 setup
The cgroups v2 setup required the rc_cgroups_controllers variable
to be set to the list of controllers to enable regardless of whether the
mode was hybrid or unified.

This makes sense for hybrid mode since the controllers can't be in both
the cgroups v1 and v2 hierarchies, but for unified mode we should enable
all controllers that are configured in the kernel.
2021-02-23 23:08:56 -06:00
William Hubbs 12ee72a9b3 allow devfs to run on lxc
X-Gentoo-Bug: 761918
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=761918
Closes #272.
2021-01-28 12:32:09 -06:00
William Hubbs 170ce2624a typo fix 2021-01-05 17:11:01 -06:00
William Hubbs 9a6698876a improve the diagnostic when the ulimit builtin fails
X-Gentoo-Bug:739274
X-Gentoo-Bug-URL:https://bugs.gentoo.org/739274
2021-01-05 17:02:30 -06:00
William Hubbs 62bc463c63 update freebsd 11.x image on cirrus ci 2020-12-20 15:37:52 -06:00
William Hubbs da30767353 supervise-daemon: do not spawn a process if we are exiting
This fixes #375 and allows us to not add another level of indentation in
the supervisor loop.
2020-11-29 21:22:43 -06:00
William Hubbs 0fab3e837b bootmisc: allow sysvinit compatibility during shutdown
Use "halt -w" to write the halt record if it exists.
Otherwise use openrc-shutdown.

This fixes #336.
2020-11-27 15:18:57 -06:00
William Hubbs 38aaba28ee scripts/shutdown.in: fix sysvinit compatible shutdown
X-Gentoo-Bug: https://bugs.gentoo.org/755422
2020-11-20 14:57:04 -06:00
William Hubbs 3ed4126a31 update news for 0.43 with info on checkpath fix 2020-11-20 10:00:34 -06:00
William Hubbs b6fef599bf checkpath: fix CVE-2018-21269
This walks the directory path to the file we are going to manipulate to make
sure that when we create the file and change the ownership and permissions
we are working on the same file.
Also, all non-terminal symbolic links must be owned by root. This will
keep a non-root user from making a symbolic link as described in the
bug. If root creates the symbolic link, it is assumed to be trusted.

On non-linux platforms, we no longer follow non-terminal symbolic links
by default. If you need to do that, add the -s option on the checkpath
command line, but keep in mind that this is not secure.

This fixes #201.
2020-11-20 09:15:59 -06:00
William Hubbs 2355f1a3f2 supervise-daemon: only log debug logs when verbose mode is active 2020-09-25 16:33:32 -05:00
William Hubbs 35ec935741 ci/travis.sh: run shellcheck on shell scripts 2019-10-28 18:42:10 -05:00
William Hubbs 54780a4582 supervise-daemon: allow --respawn-max to be zero 2019-03-29 14:09:08 -05:00
William Hubbs 44f5a72d1a remove hidden-visibility.h
I am removing this on the advice of a member of the Gentoo toolchain
team. It was explained to me that this doesn't offer any significant
benefits to OpenRC.

If anyone ffeels differently, please open a pull request reverting
this and adding an explanation of what it does and how to know which
functions to mark hidden in the future.

This fixes #301.
2019-02-26 17:47:55 -06:00
William Hubbs 0d378974bf openrc-init: fix waitpid checks
The do_openrc() function was not waiting properly for the child process
which started the runlevel to return. We need to repeatedly call
waitpid() until its return value matches the pid of the child process or
the child process does not exist.

This fixes #216.
This fixes #300.
2019-02-25 18:55:13 -06:00
William Hubbs 028da5c2e3 librc: fix potential buffer overflow in pid_is_argv
This fixes #299.
2019-02-23 17:44:07 -06:00
William Hubbs d8dbb890aa Revert "src/librc/librc-daemon.c: fix buffer overrun in pid_is_argv"
This reverts commit 084877eb52.
The mentioned commit caused some systems to have some services reported
as crashed.

This fixes #297.
This fixes #298.
2019-02-23 16:24:55 -06:00
William Hubbs 56c006ebd6 Update ChangeLog 2019-02-22 19:03:41 -06:00
William Hubbs 067088bbff move ci scripts to their own directory
This fixes #296.
2019-02-22 18:50:13 -06:00
William Hubbs 52d4e56674 combine test directories
This fixes #295.
2019-02-22 18:08:19 -06:00
William Hubbs 6e6902c28b remove unused test ignore patterns 2019-02-22 16:27:52 -06:00
William Hubbs 084823182a remove unused test data files 2019-02-22 13:25:51 -06:00
William Hubbs f9e7a00ba9 rc-status: style fixes 2019-02-15 20:36:46 -06:00
William Hubbs f1f48011ac update ChangeLog 2019-02-15 14:37:57 -06:00
William Hubbs 427a1ce299 rc-status: add -f option to allow formatting output
The -f option can be used when showing the status of services in
runlevels to allow making the output more easily parsable.
Currently, the .ini format is the only one supported.
2019-02-15 14:21:43 -06:00
William Hubbs f43cec34ca rc-status.c: small style changes 2019-02-14 13:14:31 -06:00
William Hubbs d64c9d2050 add experimental support for an alternate shell for service scripts
This is for #288.
2019-02-13 18:22:25 -06:00
William Hubbs 155b845194 improve shutdown documentation
This fixes #290.
2019-02-12 16:54:12 -06:00
William Hubbs b84d0bac4d travis-ci: add IRC notifications 2018-12-29 11:37:06 -06:00
William Hubbs 1ff3a37c60 start-stop-daemon: fix compiler warning 2018-12-28 09:31:38 -06:00
William Hubbs 7e95d924c9 bash-completions/rc-service: allow tab to be used again
X-Gentoo-Bug: 670290
X-Gentoo-Bug-URL: https://bugs.gentoo.org/670290
2018-12-27 16:31:15 -06:00
William Hubbs a32b14bbb4 Do not use UT_LINESIZE or __UT_LINESIZE
These are not standard.
For more information see issue #279.
This fixes #279.
2018-12-25 12:13:23 -06:00
William Hubbs d328de198d remove /run migration script again
This time it was done correctly.
I missed a '\' the last time.
2018-12-23 21:04:00 -06:00
William Hubbs 894995176e Revert "remove /run migration script"
For some reason removing this broke the build.

This reverts commit 5246ea7b6f.
2018-12-23 18:13:06 -06:00
William Hubbs 5246ea7b6f remove /run migration script
We have used /run for some time now and we have had this migration
script for 6 years. Linux users should have upgraded by now to a version
of OpenRC which stores its information in /run.
2018-12-23 17:49:34 -06:00
William Hubbs ed8b768c4a fix compiler warnings 2018-12-21 12:06:15 -06:00
William Hubbs 825caa14de supervise-daemon: do not use the exec_service() function
In order to run healthcheck() and the unhealthy() function, add an
exec_command call to the supervisor.
Another difference is This function also logs errors instead of
attempting to display them.

This is for #271.
2018-12-20 17:39:31 -06:00
William Hubbs d5c396cbfc Add debug logging to start-stop-daemon and rc-supervisor
This will make it easier to track down why the supervisor intermittently
hangs after it runs for a long time.
2018-12-18 11:29:26 -06:00
William Hubbs 5427783fdf standardize the default shell
I do not know of a need to have the default shell be a build-time
configurable setting. All *nix systems I am aware of have /bin/sh as a
default posix compatible shell.
If some systems running OpenRC do not make that assumption about
/bin/sh, I will consider bringing this back, so feel free to open an
issue.
2018-12-08 12:06:26 -06:00
William Hubbs d95425b08a rc-cgroup.sh: remove shebang line
This is not a stand-alone script, so it does not need the shebang line.
This also means it is not necessary to run this through sed.
2018-12-07 15:31:13 -06:00
William Hubbs 76420d9849 init.d/agetty: set default respawn period to 60 seconds
Without a respawn period setting, the supervisor will give up on
respawning agetty after it is respawned respawn_max times. For most
daemons giving up like this is reasonable, but not for agettys. Agettys
should always be respawned unless they are respawning too fafst,.

If an agetty is respawning faster than 10 times in 60 seconds, this
seems to be too fast.
2018-12-06 16:37:40 -06:00
William Hubbs bebc604438 supervise-daemon: fix busy loop
This fixes #264.
2018-12-06 16:22:15 -06:00
William Hubbs d126542dc6 version 0.41 2018-12-03 18:14:34 -06:00
William Hubbs ab6c8d56f1 Update ChangeLog 2018-12-03 15:56:19 -06:00
William Hubbs 9a2115f762 rc-status: show status for supervised services instead of a list 2018-12-03 15:16:17 -06:00
William Hubbs eeba6df476 Update supervise-daemon man page 2018-12-03 13:08:25 -06:00
William Hubbs ac42e81a64 supervise-daemon.sh: drop the unused stopsig variable 2018-12-03 12:43:12 -06:00
William Hubbs af70862a7a supervise-daemon: use a default pid file if one is not specified
Since the pid file is internal to us, start moving toward deprecating it
by not requiring the user to specify it.
In the next release, I plan on working on code to start phasing out the
use of a pid file if this is possible.
2018-12-03 12:41:29 -06:00
William Hubbs fa6611b5af rc-status: add --supervised option to show supervised services 2018-12-02 18:33:25 -06:00
William Hubbs db01442580 rc-status: show failed services as failed 2018-12-02 18:33:25 -06:00
William Hubbs ebf79db79e supervise-daemon: mark a service failed if it respawns too many times 2018-12-02 18:33:25 -06:00
William Hubbs 1b5a3b4ef4 supervise-daemon: make respawn-max and respawn-period independent settings 2018-12-02 18:33:25 -06:00
William Hubbs 77262c359c supervise-daemon: add support for a fifo
This will allow us to signal the daemon we are supervising as well as
send other commands to the supervisor in the future.

This fixes #227.
2018-12-02 18:33:25 -06:00
William Hubbs 7f23e0461d supervise-daemon: rework signal handling and main loop
This is needed in preparation for adding support for a fifo to allow us
to communicate with the supervisor to ask it to signal the child it is
supervising.
2018-12-02 18:33:25 -06:00
William Hubbs ff4af908a5 Revert "checkpath: use O_PATH when available"
This reverts commit 2af0cedd59.

After speaking with Luis Ressel on the Gentoo selinux team, I am reverting
this commit for the following reasons:

- Luis told me that he feels this is not the solution we need to address
  the concern with checkpath; I will be working with him on another
  solution.

- There are concerns about the way the path variable was handled
  and the assert() call.
  The path variable should be dynamically allocated using xasprintf
  instead of defining a length at compile time. This would eliminate the
  need for the assert() call.

- It introduces the definition of _GNU_SOURCE which makes it
  easier to introduce portability concerns in the future (see #262).
2018-12-02 16:08:42 -06:00
William Hubbs ee41e444ad rc.conf: typo fix
X-Gentoo-Bug: 670874
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=670874
2018-11-29 08:19:56 -06:00
William Hubbs b7828651ba supervise-daemon: fix type of exiting flag 2018-11-28 16:06:07 -06:00
William Hubbs 0f704402a2 supervise-daemon: make the pidfile an implementation detail
The pidfile of the supervisor doesn't need to be adjustable by the
service script. It is only used so the supervisor can stop itself when
the --stop option is used.
2018-11-15 14:15:15 -06:00
William Hubbs 2504a2c25b Do not complain if interrupted by a signal
In start-stop-daemon and rc-schedules, we were printing out a warning if
the nanosleep call was interrupted by a signal, but we did not treat
this as an error situation other than displaying the message, so there
is no need for the message.
2018-11-15 14:03:06 -06:00
William Hubbs 7eb3975543 Create save-keymaps and save-ktermencoding services
These services represent the parts of the keymaps and termencoding
services which saved the settings back to the root file system so they
can be loaded very early in the boot process.
These are needed to allow keymaps and termencoding to run earlier in the
boot sequence.

X-Gentoo-Bug: 446018
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=446018
2018-11-07 08:55:44 -06:00
William Hubbs 60e60dc9bb supervise-daemon.sh: drop invalid --signal switch
This fixes #230.
2018-11-06 10:54:02 -06:00
William Hubbs 008c9d0036 supervise-daemon: reap zombies
We need to make sure to reap zombies so that we can shut down
successfully.

Fixes #252.
Possibly related to #250.
2018-11-05 21:35:00 -06:00
William Hubbs 025c9693cc rc-service: fix help output 2018-11-05 11:39:39 -06:00
William Hubbs ee3c4afdb7 openrc-init: add SELinux support
This is for #173.
2018-11-02 18:22:11 -05:00
William Hubbs e2416d0893 openrc-shutdown: do not require a time for -w switch
X-Gentoo-Bug: 669500
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=669500
2018-10-24 15:24:40 -05:00
William Hubbs a2bcfeb428 version 0.40 2018-10-24 15:18:10 -05:00
William Hubbs 53f7afd3b3 Update ChangeLog 2018-10-23 17:14:01 -05:00
William Hubbs 75e9b66f6f news.md: add information about the modules service changes 2018-10-23 16:59:20 -05:00