Commit Graph

46 Commits

Author SHA1 Message Date
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
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
9ebd5a6aff Add support for DragonFly BSD 2013-07-25 22:33:24 -05:00
d0bc4f20ad drop useless "All rights reserved" notice
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-06-29 19:46:31 -04:00
fe18c7bb63 librc: tweak style: foo () -> foo()
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-05-28 11:53:29 -04:00
b2d0656814 Style fix: "char *foo" not "char* foo". 2011-01-17 08:46:41 +00:00
e6fc30da61 Clean up all trailing whitespace in src/. 2011-01-17 08:28:43 +00:00
658a220638 Add (c) to Copyright 2009-05-01 15:11:40 +01:00
0feddbd815 Use kill for the pid check as it's fast. 2009-04-25 20:44:13 +00:00
ade85d4bd8 Improve style for KNF 2009-04-23 21:31:22 +00:00
f23822e082 Copyright 2009-01-12 10:24:00 +00:00
8a9a2d5fe9 Use snprintf instead of strlcpy to save on size if not available. 2009-01-12 08:31:03 +00:00
13d88731b7 We don't check exec when starting, so don't when testing for crashed. 2008-09-22 20:07:14 +00:00
6b3d8cf598 Fix stopping wpa_supplicant incorrectly, #107 2008-09-19 11:24:21 +00:00
cea206014d Attempt to make s-s-d simpler by not enforcing the need for a full path and maybe working better with interpreted scripts. 2008-07-27 11:30:49 +00:00
5188fd2592 Wups, test compiles before commiting :) 2008-04-30 16:33:54 +00:00
5b800030f1 Remove redundant checking of /proc/pid/exe 2008-04-30 16:26:05 +00:00
208443fa0e Save a few bytes and make it easier to read. 2008-04-30 15:26:29 +00:00
a818eebf7b No need to init this. 2008-04-30 12:26:38 +00:00
10910876d1 Make the function a little smaller. 2008-04-30 10:55:42 +00:00
35b4978152 Style 2008-04-30 10:31:06 +00:00
54d7aa39dd If we don't have permission to inspect the pidfile, don't report crashed. Gentoo #218028. 2008-04-21 10:56:28 +00:00
15d34d0a16 Add license blurb to a few files and append my email to my name. 2008-03-26 17:53:37 +00:00
e505e6ea41 We should only free the buffer when done reading the dir. 2008-03-21 08:31:04 +00:00
51c825ceee Make rc_getline private and save it's buffer so it's sort of like getline from glibc. 2008-03-17 21:27:37 +00:00
c74cfabe2e init some vars. 2008-03-17 16:42:31 +00:00
b2f7606b23 We should check for NULL here. 2008-03-17 14:31:44 +00:00
4c14666423 Punt the rc_strcatpaths function and use snprintf instead to save on expensive malloc calls. 2008-03-17 13:25:56 +00:00
50a7697bf2 rc_find_pids now returns RC_PIDLIST instead of a NULL terminated array. 2008-03-17 09:59:52 +00:00
cb9da6a262 Remove null terminated char ** lists in favour of RC_STRINGLIST, using TAILQ from queue(3). Refactor code style around the BSD KNF. 2008-03-16 17:00:56 +00:00
54afc10aa4 Sanitise the BSD defines a little. 2008-03-03 19:55:29 +00:00
5971d14afd Ensure that normal users can use s-s-d on NetBSD. 2008-03-03 09:57:48 +00:00
8b4b958678 Now that s-s-d accepts >1 argument for stopping a daemon on match we need to store all arguments used incase a service started the same daemon more than once with different paramters. 2008-02-23 00:26:11 +00:00
ad780077d2 Welcome to 2008. 2008-02-22 12:07:34 +00:00
eedf63906d Fix compile on FreeBSD. 2008-02-18 16:26:49 +00:00
b0442b3193 We need to check for contents of argv too. 2008-02-18 16:01:04 +00:00
d904acf448 Fix a signed error. 2008-02-18 13:37:58 +00:00
27f97f2106 We need to be able to locate pids by argv, instead of just argv0. 2008-02-17 15:12:00 +00:00
9854f9e3ee Use _PATH_DEVNULL on FreeBSD when using kvm_openfiles so we work in a jail, bug #21. 2008-02-13 23:44:17 +00:00
61e36be694 Add xzalloc function to reduce size. 2008-01-30 14:34:55 +00:00
9ce3086bf5 Fix service_started_daemon, bug #11 2008-01-28 13:16:33 +00:00
b4bff9ce5e Quiet some lint warnings. 2008-01-22 10:29:15 +00:00
6aab712cb4 strip trailing newlines 2008-01-14 05:05:22 +00:00
abde759d5b Re-indent to a standard tw of 8. 2008-01-11 15:51:40 +00:00
43d0f3fc76 rc_getline keeps expanding it's malloced buffer until it has read a whole line or EOF. All functions which read into static buffers have been changed to use fhis function to avoid any potential overflows and to ensure we really do read a long long config line. 2008-01-07 12:29:30 +00:00
ac21d75300 Add some .mk stubs to impersonate bsk .mk files to make writing our Makefiles easier. libeinfo, librc and rc now have their own seperate directories. More work is needed to tidy this up though. 2008-01-05 19:25:55 +00:00