Commit Graph

3630 Commits

Author SHA1 Message Date
Anna (navi) Figueiredo Gomes
d80792c421 ci: use ubuntu-24.04 image for coverity as well
This will be used until the roll-out is completed in the following
issue:

Bug: https://github.com/actions/runner-images/issues/10636
2024-11-02 17:45:37 +01:00
William Hubbs
15e5d19177 build: update defaults for bindir and sbindir 2024-11-01 16:25:12 -05:00
William Hubbs
37c3d13acd build: update meson version 2024-11-01 16:25:12 -05:00
William Hubbs
0fbfc9af65 ci: use ubuntu-24.04 image
This will be used until the roll-out is completed in the following
issue:

Bug: https://github.com/actions/runner-images/issues/10636
2024-11-01 16:25:12 -05:00
William Hubbs
78c61d8957 Revert "build: set defaults for bindir and sbindir"
This failed in our CI for Ubuntu.

https://github.com/OpenRC/openrc/actions/runs/11634128004/job/32400729759#step:5:17
This reverts commit 4d30e2bf8b.
2024-11-01 13:40:47 -05:00
William Hubbs
4d30e2bf8b build: set defaults for bindir and sbindir 2024-11-01 13:08:32 -05:00
Mike Gilbert
08d7def0fd STYLE-GUIDE: modernize bug tag to match Gentoo usage 2024-10-26 22:01:57 +02:00
Anna (navi) Figueiredo Gomes
5d186b34a1 librc-depend, gendepends: Use rc_scriptdirs for lookup of services. 2024-10-26 20:24:55 +02:00
Anna (navi) Figueiredo Gomes
9c0cf7ef9d librc, rc, supervise-daemon: Repace hardcoded paths with function calls.
This lays the groundwork for other features like user services, or
a different root prefix, by allowing us to change where openrc looks up
for files at runtime.
2024-10-26 20:24:55 +02:00
Mark Hindley
5ef072d648 Niceness cannot be set using rc_ulimit.
Fixes https://github.com/OpenRC/openrc/issues/701
2024-10-26 16:09:00 +02:00
Mark Hindley
5874b2ca75 rc_ulimit: support multiple limits.
Fixes https://github.com/OpenRC/openrc/issues/399#issuecomment-810461921
2024-10-26 16:09:00 +02:00
William Hubbs
2495166770 build: drop MAXPATHLEN definition
This is no longer used in the code, so we can drop it.
2024-10-25 10:12:58 -05:00
Anna (navi) Figueiredo Gomes
cadc1d2840 librc: Remove rc_getline.
getline(3) got standardized in posix 2008 and is common place on all
libc implementations now a days, and rc_getline is tagged for removal
for ages now.
2024-09-24 13:36:13 -05:00
Anna (navi) Figueiredo Gomes
64c3b3e757 misc: Replace rc_getline and getline with xgetline.
rc_getline is an implementation from when getline wasn't available on
most libcs, and is planned for removal, however much of of the code
relies on it's behaviour of removing new lines at the end of strings.

To avoid duplicating the new line removal logic in a dozen places, we
introduce a new helper function xgetline, which just wraps around
getline but removes the new line at the end.
2024-09-24 13:36:13 -05:00
William Hubbs
7c31e504d5 build: drop ROOTPREFIX setting
This change removes the ROOTPREFIX build setting.

If your OS expects to have / mounted earlier in the boot process than
/usr, you will need to pass the appropriate directory settings to "meson
setup" as part of the build process, for example:

$ meson setup \
    --bindir /bin --libdir /lib64 --libexecdir /lib --sbindir /sbin \
    build

also, move plugins  to ```libdir/rc/plugins``` which is the standard
location for plugins accessed via dlopen.
2024-09-23 13:23:12 -05:00
Mark Hindley
4e0c16abd5 openrc-run: Use SIGUSR1 to skip marking.
The current code for mark_service comments that a service marking itself
should make openrc-run skip marking it based on the exit code, but
openrc-run does not respect the signal.
2024-09-23 19:09:46 +02:00
William Hubbs
d98d7eb742 FEATURE-REMOVAL-SCHEDULE: remove section on rc and runscript symlinks
these were removed some time ago and there have been no issues, so we
can remove the information from this file.
2024-09-23 14:54:38 +02:00
William Hubbs
50a338b96a librc: remove gentoo prefix support 2024-09-20 11:26:34 -05:00
William Hubbs
723fa1eac1 remove RC_PREFIX environment variable
This was only used in gentoo prefix installations which we no longer
support.
2024-09-20 10:28:19 -05:00
Anna (navi) Figueiredo Gomes
171ba6d836 librc: Use proper string length in file_regex.
Currently the code uses the total size of the buffer as the bounds for
looping \0 separated fields, which leads to reading uninitialized data
and possibly overrun the buffer during regexec.

Observed on musl while matching /proc/cpuinfo.
2024-09-18 12:35:16 -05:00
Mike Gilbert
8cafbb76bc librc: fix getline return value check
Bug: https://bugs.gentoo.org/939758
Fixes: 0702a064a9
Signed-off-by: Mike Gilbert <floppym@gentoo.org>
2024-09-17 08:34:08 +02:00
William Hubbs
123872c5a0 build: drop the required keyword when set to true 2024-09-13 11:20:06 -05:00
William Hubbs
414b575acb make libcap a hard requirement
For linux systems, libcap is a lightweight dependency. Also, making it
optional requires that service scripts be written to deal with the
possibility that capabilities are not supported.

This fixes #739.

X-Gemtoo-Bug: https://bugs.gentoo.org/939543
2024-09-13 11:20:06 -05:00
William Hubbs
f4ece6c945 version 0.55 2024-09-09 14:57:12 -05:00
William Hubbs
a7554df1a0 update news 2024-09-09 14:54:05 -05:00
Anna (navi) Figueiredo Gomes
ea310b2e58 init.d/root.in: fix eend message 2024-07-28 04:07:36 +02:00
Dominique Martinet
6bfef87736 init.d/root: add support for 'r?shared' fstab option on /
containers on linux might require filesystems to be mounted with
different propagation than the kernel default of 'private':
by setting 'shared' in fstab for / options, one can now make the
fs hierarchy shared.

Note we use 'rshared' to make other existing mounts shared as well
because the setting is contagious and it seemed more logical to
behave as if the setting was set on / immediately (and thus inherited
by other mounts)

This fixes #525.
2024-07-28 04:06:23 +02:00
Kanako the Gay
ba6de6db46 Podman detection in FreeBSD 2024-07-25 14:09:10 +02:00
Kanako the Gay
089c473c87 Move podman check above docker 2024-07-25 14:09:10 +02:00
Kanako the Gay
b94dc7d8ab Podman detection 2024-07-25 14:09:10 +02:00
Anna (navi) Figueiredo Gomes
bd18358134 man/start-stop-daemon.8: update --scheduler flag 2024-07-24 04:12:20 +02:00
Natanael Copa
c32595491c start-stop-daemon: fix setting scheduler with musl
Linux does not provide a way to set scheduling parameters for a process,
only for threads, so musl sched_setscheduler() is only a stub and the
glibc implementation does "the wrong thing".

Use pthread_setschedparam everywhere so we don't depend on any
implementation specific behavior.

ref: https://www.openwall.com/lists/musl/2016/03/01/5
fixes: https://github.com/OpenRC/openrc/issues/689
2024-07-24 04:11:13 +02:00
Anna (navi) Figueiredo Gomes
ceadfaa538 meson.build: add -Wmismatched-dealloc 2024-07-23 15:14:35 -05:00
Anna (navi) Figueiredo Gomes
56b91f9f7e librc-depend.c: add make_deptree function 2024-07-23 15:14:35 -05:00
Anna (navi) Figueiredo Gomes
f1543bdcab test/check-xfunc-usage.sh: allow '__attribute__ ((malloc ())' 2024-07-23 15:14:35 -05:00
Mike Gilbert
ca1901ea70 openrc-init: replace putenv with setenv
Avoids compiler warning about discarded const.

Signed-off-by: Mike Gilbert <floppym@gentoo.org>
2024-07-23 20:45:18 +02:00
William Hubbs
513ce77b12 build: clean up unused arguments in meson_final.sh 2024-07-23 12:52:35 -05:00
William Hubbs
466662d8c1 build: install symlinks natively with meson 2024-07-23 16:23:37 +02:00
Anna (navi) Figueiredo Gomes
f943bc4c9a libeinfo.c: add foot to the term list 2024-07-22 17:59:58 -05:00
Anna (navi) Figueiredo Gomes
446e621693 librc/librc-depend.c: small refactor
some changes for code redability, and fixing leaking the whole internals
of the deptree at the end of rc_deptree_update.
2024-07-22 17:35:08 -05:00
Anna (navi) Figueiredo Gomes
6ddec6a884 rc-status.c: fix memory leaks 2024-07-22 17:24:21 -05:00
Anna (navi) Figueiredo Gomes
036fa55e9b rc.c: fix memory leaks 2024-07-22 17:24:21 -05:00
Anna (navi) Figueiredo Gomes
0702a064a9 librc-misc.c: fix memory leaks 2024-07-22 17:24:21 -05:00
Anna (navi) Figueiredo Gomes
a75b9dce78 shared/plugin.c: fix incompatible function warning. 2024-07-22 16:58:11 -05:00
Doug Freed
3277e6552f start-stop-daemon: open syslog
The stop schedule code calls syslog, so we need to open a syslog
connection so the process name will get properly logged on musl, and we
can ensure the pid gets logged and the right facility is used.
2024-07-22 16:24:47 -05:00
Mike Gilbert
53071ceb13 openrc-shutdown: simplify broadcast function
Get rid of the alarm/setjmp/longjmp.
Trust that the kernel will not block with O_NDELAY.
Use write() instead of stdio.

Bug: https://bugs.gentoo.org/923326
Signed-off-by: Mike Gilbert <floppym@gentoo.org>
2024-07-22 16:15:38 -05:00
Anna (navi) Figueiredo Gomes
096cf6bbc2 meson.build: restore pkg-config filename to openrc.pc 2024-07-22 15:16:32 -05:00
Matt Jolly
5a694044ed Generate pkg-config files directly
- Remove 'pkgconfig' subdir
- use meson 'pkgconfig' module to generate and install appropriate
  .pc files when required.
- add `rc_path` variable to installed pkgconfig files

Signed-off-by: Matt Jolly <kangie@gentoo.org>
2024-07-22 14:58:46 -05:00
William Hubbs
917a7031d9 remove the openrc-service-script bash completion
Bash completion has two official completion directories:

- completionsdir, a lazy loading mechanism
- compatdir, an eager loading mechanism

Modern style is to use lazy loading if possible. It is modern
technology, speeds up your shell by deferring loads, and is generally
recommended for applications to prefer by default. It requires you name
your completion script using the same name as the command to complete.
Every distro prefers you do this, but only because bash-completion
itself does.

The openrc-service-script completion doesn't provide a completion for a
command called openrc-service-script. It cannot use the lazy loading
mechanism and emits a warning in Gentoo's policy lints as a result.
Installing to the completionsdir is therefore a useless no-op. Better to
install nothing.

The compatdir is the correct location for completions that cannot be
lazy loaded and must be loaded at shell startup in order to correctly
register themselves for a globbed list of commands that can only be
ascertained dynamically at shell startup. The alternative is to have
every command that can be globbed install a symlink to
openrc-service-script, and install openrc-service-script to a third
location.
2024-06-28 14:41:24 -05:00
William Hubbs
4dfec917cc Fix install location of openrc-service-script bash completion
X-Gentoo-Bug-URL: https://bugs.gentoo.org/925409
2024-06-25 17:30:43 -05:00