Compare commits
	
		
			3 Commits
		
	
	
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|   | 81ce908e42 | ||
|   | aa867fd7e3 | ||
|   | c921a8647b | 
							
								
								
									
										14
									
								
								.travis.yml
									
									
									
									
									
								
							
							
						
						
									
										14
									
								
								.travis.yml
									
									
									
									
									
								
							| @@ -1,14 +0,0 @@ | ||||
| # Travis build integration. | ||||
| # https://docs.travis-ci.com/ | ||||
|  | ||||
| language: c | ||||
|  | ||||
| os: | ||||
|   - linux | ||||
|  | ||||
| compiler: | ||||
|   - gcc | ||||
|   - clang | ||||
|  | ||||
| script: | ||||
|   - ./test/travis.sh | ||||
							
								
								
									
										740
									
								
								ChangeLog
									
									
									
									
									
								
							
							
						
						
									
										740
									
								
								ChangeLog
									
									
									
									
									
								
							| @@ -1,338 +1,4 @@ | ||||
| commit 63e40f31bfc7d8908fee8059ea383038832dd84f | ||||
| Author: William Hubbs <w.d.hubbs@gmail.com> | ||||
| Commit: William Hubbs <w.d.hubbs@gmail.com> | ||||
|  | ||||
|     fix compiler warnings | ||||
|  | ||||
| commit e43ee29eb4310ff23c438d1877ef79c56539b002 | ||||
| Author: William Hubbs <w.d.hubbs@gmail.com> | ||||
| Commit: William Hubbs <w.d.hubbs@gmail.com> | ||||
|  | ||||
|     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. | ||||
|  | ||||
| commit a3555b144291b7d32f7c14fd9bd0dbe3ee6e33f9 | ||||
| Author: William Hubbs <w.d.hubbs@gmail.com> | ||||
| Commit: William Hubbs <w.d.hubbs@gmail.com> | ||||
|  | ||||
|     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. | ||||
|  | ||||
| commit eb863156fbcbce236c60dec0e90338edbd9de686 | ||||
| Author: William Hubbs <w.d.hubbs@gmail.com> | ||||
| Commit: William Hubbs <w.d.hubbs@gmail.com> | ||||
|  | ||||
|     version 0.40.3 | ||||
|  | ||||
| commit ac76b24b85d3767a9561b76ac0fee5569383a63a | ||||
| Author: William Hubbs <w.d.hubbs@gmail.com> | ||||
| Commit: William Hubbs <w.d.hubbs@gmail.com> | ||||
|  | ||||
|     Update ChangeLog | ||||
|  | ||||
| commit b8e57c693a973528799c9a5fdf86135b658dcce2 | ||||
| Author: William Hubbs <w.d.hubbs@gmail.com> | ||||
| Commit: William Hubbs <w.d.hubbs@gmail.com> | ||||
|  | ||||
|     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. | ||||
|  | ||||
| commit 5df12e24146cd091de71c77737c07eed5a14101f | ||||
| Author: William Hubbs <w.d.hubbs@gmail.com> | ||||
| Commit: William Hubbs <w.d.hubbs@gmail.com> | ||||
|  | ||||
|     supervise-daemon: fix busy loop | ||||
|      | ||||
|     This fixes #264. | ||||
|  | ||||
| commit 461df0c78b1b8a58bb272958dce4af39fc2549c0 | ||||
| Author: William Hubbs <w.d.hubbs@gmail.com> | ||||
| Commit: William Hubbs <w.d.hubbs@gmail.com> | ||||
|  | ||||
|     version 0.40.2 | ||||
|  | ||||
| commit cefae65392568afac83f64773b6ad33462791c38 | ||||
| Author: William Hubbs <w.d.hubbs@gmail.com> | ||||
| Commit: William Hubbs <w.d.hubbs@gmail.com> | ||||
|  | ||||
|     Update ChangeLog | ||||
|  | ||||
| commit 69fbd129938522cdd9b82fea2b83c857796a32af | ||||
| Author: Alexander Zubkov <green@msu.ru> | ||||
| Commit: William Hubbs <w.d.hubbs@gmail.com> | ||||
|  | ||||
|     supervise-daemon: redirect std{in,out,err} to /dev/null after demonizing | ||||
|      | ||||
|     This fixes #239. | ||||
|  | ||||
| commit 4aa5686d9037132b27d7554436738fa98e8e9057 | ||||
| Author: William Hubbs <w.d.hubbs@gmail.com> | ||||
| Commit: William Hubbs <w.d.hubbs@gmail.com> | ||||
|  | ||||
|     version 0.40.1 | ||||
|  | ||||
| commit ab6c8d56f155564f56d61553c4b1af9e7f63a9d2 | ||||
| Author: William Hubbs <w.d.hubbs@gmail.com> | ||||
| Commit: William Hubbs <w.d.hubbs@gmail.com> | ||||
|  | ||||
|     Update ChangeLog | ||||
|  | ||||
| commit fb4dd351c7ef2614076309d630e163ff963ac8bf | ||||
| Author: Austin English <austinenglish@gmail.com> | ||||
| Commit: William Hubbs <w.d.hubbs@gmail.com> | ||||
|  | ||||
|     misc: make checks always fatal | ||||
|      | ||||
|     This fixes #263. | ||||
|  | ||||
| commit 10dc65cc46e4f16f1b1f9822f3b687f2e58e4b40 | ||||
| Author: Austin English <austinenglish@gmail.com> | ||||
| Commit: William Hubbs <w.d.hubbs@gmail.com> | ||||
|  | ||||
|     src/rc/supervise-daemon.c: fix style issue | ||||
|      | ||||
|     This is for #263. | ||||
|  | ||||
| commit 9a2115f7620b33e03592fb1eabe5a613984a9894 | ||||
| Author: William Hubbs <w.d.hubbs@gmail.com> | ||||
| Commit: William Hubbs <w.d.hubbs@gmail.com> | ||||
|  | ||||
|     rc-status: show status for supervised services instead of a list | ||||
|  | ||||
| commit eeba6df4761777be5af7f9a2876223155921ee37 | ||||
| Author: William Hubbs <w.d.hubbs@gmail.com> | ||||
| Commit: William Hubbs <w.d.hubbs@gmail.com> | ||||
|  | ||||
|     Update supervise-daemon man page | ||||
|  | ||||
| commit ac42e81a6419b281ed3f62900e29a5a802106dce | ||||
| Author: William Hubbs <w.d.hubbs@gmail.com> | ||||
| Commit: William Hubbs <w.d.hubbs@gmail.com> | ||||
|  | ||||
|     supervise-daemon.sh: drop the unused stopsig variable | ||||
|  | ||||
| commit af70862a7a115d6269affca663423e9340d6e929 | ||||
| Author: William Hubbs <w.d.hubbs@gmail.com> | ||||
| Commit: William Hubbs <w.d.hubbs@gmail.com> | ||||
|  | ||||
|     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. | ||||
|  | ||||
| commit fa6611b5af94548e901e587fcd36f4fb59124975 | ||||
| Author: William Hubbs <w.d.hubbs@gmail.com> | ||||
| Commit: William Hubbs <w.d.hubbs@gmail.com> | ||||
|  | ||||
|     rc-status: add --supervised option to show supervised services | ||||
|  | ||||
| commit db01442580847d36f232527200e50091431c32b5 | ||||
| Author: William Hubbs <w.d.hubbs@gmail.com> | ||||
| Commit: William Hubbs <w.d.hubbs@gmail.com> | ||||
|  | ||||
|     rc-status: show failed services as failed | ||||
|  | ||||
| commit ebf79db79eaa2df0ceb62b4edbef94e68a28b612 | ||||
| Author: William Hubbs <w.d.hubbs@gmail.com> | ||||
| Commit: William Hubbs <w.d.hubbs@gmail.com> | ||||
|  | ||||
|     supervise-daemon: mark a service failed if it respawns too many times | ||||
|  | ||||
| commit 1b5a3b4ef4b2c3e20cfe4a71cf38c63279ed42d2 | ||||
| Author: William Hubbs <w.d.hubbs@gmail.com> | ||||
| Commit: William Hubbs <w.d.hubbs@gmail.com> | ||||
|  | ||||
|     supervise-daemon: make respawn-max and respawn-period independent settings | ||||
|  | ||||
| commit 77262c359c4aaf15ba00b07cd51f3987ce514769 | ||||
| Author: William Hubbs <w.d.hubbs@gmail.com> | ||||
| Commit: William Hubbs <w.d.hubbs@gmail.com> | ||||
|  | ||||
|     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. | ||||
|  | ||||
| commit 7f23e0461d6c6d24f5cfa39b9e404a7ec9cfd9c1 | ||||
| Author: William Hubbs <w.d.hubbs@gmail.com> | ||||
| Commit: William Hubbs <w.d.hubbs@gmail.com> | ||||
|  | ||||
|     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. | ||||
|  | ||||
| commit ff4af908a58eedf9a165946f109f06add23fff9c | ||||
| Author: William Hubbs <w.d.hubbs@gmail.com> | ||||
| Commit: William Hubbs <w.d.hubbs@gmail.com> | ||||
|  | ||||
|     Revert "checkpath: use O_PATH when available" | ||||
|      | ||||
|     This reverts commit 2af0cedd5952d7da71681b7a636dff3540e4295d. | ||||
|      | ||||
|     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). | ||||
|  | ||||
| commit 2af0cedd5952d7da71681b7a636dff3540e4295d | ||||
| Author: Mike Gilbert <floppym@gentoo.org> | ||||
| Commit: Mike Frysinger <vapier@gmail.com> | ||||
|  | ||||
|     checkpath: use O_PATH when available | ||||
|      | ||||
|     This avoids opening directories/files with read permission, which is | ||||
|     sometimes rejected by selinux policy. | ||||
|      | ||||
|     Bug: https://bugs.gentoo.org/667122 | ||||
|  | ||||
| commit ee41e444ad18192fa34f598464e3ac52f323e27e | ||||
| Author: William Hubbs <w.d.hubbs@gmail.com> | ||||
| Commit: William Hubbs <w.d.hubbs@gmail.com> | ||||
|  | ||||
|     rc.conf: typo fix | ||||
|      | ||||
|     X-Gentoo-Bug: 670874 | ||||
|     X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=670874 | ||||
|  | ||||
| commit b7828651babd20fb6cc11aed91721e103ccbb3e1 | ||||
| Author: William Hubbs <w.d.hubbs@gmail.com> | ||||
| Commit: William Hubbs <w.d.hubbs@gmail.com> | ||||
|  | ||||
|     supervise-daemon: fix type of exiting flag | ||||
|  | ||||
| commit e96f7d5658950ddee68e54fba4b6321b9a6a2ed8 | ||||
| Author: Austin English <austinenglish@gmail.com> | ||||
| Commit: Mike Frysinger <vapier@gmail.com> | ||||
|  | ||||
|     src/tests/runtests.sh: add a FATAL_CHECKS variable to make whitespace/etc. fatal | ||||
|  | ||||
| commit 28b73fc524096d5b2205fea25943410725d6227f | ||||
| Author: Austin English <austinenglish@gmail.com> | ||||
| Commit: Mike Frysinger <vapier@gmail.com> | ||||
|  | ||||
|     src/rc/openrc-shutdown.c: fix style | ||||
|  | ||||
| commit 7a00c63420f81797b3e0cc402f756b63fe06f7d4 | ||||
| Author: Austin English <austinenglish@gmail.com> | ||||
| Commit: Mike Frysinger <vapier@gmail.com> | ||||
|  | ||||
|     fix misc whitespace issues | ||||
|  | ||||
| commit f4597c546a998085e09880aa6663d1d6ee05fac4 | ||||
| Author: Austin English <austinenglish@gmail.com> | ||||
| Commit: Mike Frysinger <vapier@gmail.com> | ||||
|  | ||||
|     give TravisCI a try | ||||
|  | ||||
| commit e10afc8e757fb914e632e9c40fc6e589e6d47580 | ||||
| Author: Austin English <austinenglish@gmail.com> | ||||
| Commit: Mike Frysinger <vapier@gmail.com> | ||||
|  | ||||
|     sh/functions.sh.in: return a different value for invalid input in yesno() | ||||
|  | ||||
| commit 0f704402a236d385e8b30083ccf9aca327c0a57e | ||||
| Author: William Hubbs <w.d.hubbs@gmail.com> | ||||
| Commit: William Hubbs <w.d.hubbs@gmail.com> | ||||
|  | ||||
|     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. | ||||
|  | ||||
| commit 2504a2c25bc0587b36d81a2d85c203b20e2d40cf | ||||
| Author: William Hubbs <w.d.hubbs@gmail.com> | ||||
| Commit: William Hubbs <w.d.hubbs@gmail.com> | ||||
|  | ||||
|     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. | ||||
|  | ||||
| commit 7eb3975543eafd44c6946ca5a76812aa0d7a7303 | ||||
| Author: William Hubbs <w.d.hubbs@gmail.com> | ||||
| Commit: William Hubbs <w.d.hubbs@gmail.com> | ||||
|  | ||||
|     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 | ||||
|  | ||||
| commit 60e60dc9bbf0e3a18d897861367d9289ae8006d6 | ||||
| Author: William Hubbs <w.d.hubbs@gmail.com> | ||||
| Commit: William Hubbs <w.d.hubbs@gmail.com> | ||||
|  | ||||
|     supervise-daemon.sh: drop invalid --signal switch | ||||
|      | ||||
|     This fixes #230. | ||||
|  | ||||
| commit 008c9d0036e348242e323c0b5a66f3724b4a839d | ||||
| Author: William Hubbs <w.d.hubbs@gmail.com> | ||||
| Commit: William Hubbs <w.d.hubbs@gmail.com> | ||||
|  | ||||
|     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. | ||||
|  | ||||
| commit 025c9693ccab9c6220520ace47aa81553e7ea600 | ||||
| Author: William Hubbs <w.d.hubbs@gmail.com> | ||||
| Commit: William Hubbs <w.d.hubbs@gmail.com> | ||||
|  | ||||
|     rc-service: fix help output | ||||
|  | ||||
| commit ee3c4afdb75b98cd472b7ffbb46adc9d8a1e1b15 | ||||
| Author: William Hubbs <w.d.hubbs@gmail.com> | ||||
| Commit: William Hubbs <w.d.hubbs@gmail.com> | ||||
|  | ||||
|     openrc-init: add SELinux support | ||||
|      | ||||
|     This is for #173. | ||||
|  | ||||
| commit e2416d089396e2b9a72cc56ef9f57886ffb0f1c8 | ||||
| commit aa867fd7e3d250aba6132b490350b1a6cb38bc34 | ||||
| Author: William Hubbs <w.d.hubbs@gmail.com> | ||||
| Commit: William Hubbs <w.d.hubbs@gmail.com> | ||||
|  | ||||
| @@ -341,11 +7,11 @@ Commit: William Hubbs <w.d.hubbs@gmail.com> | ||||
|     X-Gentoo-Bug: 669500 | ||||
|     X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=669500 | ||||
|  | ||||
| commit a2bcfeb42882b40ca23ddfefca2a17a7988f8082 | ||||
| commit c921a8647bd724934d9a1590d2d14f9fb4a3e084 | ||||
| Author: William Hubbs <w.d.hubbs@gmail.com> | ||||
| Commit: William Hubbs <w.d.hubbs@gmail.com> | ||||
|  | ||||
|     version 0.40 | ||||
|     version 0.39.1 | ||||
|  | ||||
| commit 53f7afd3b3daf659d58d6545dc79cd45c4c54277 | ||||
| Author: William Hubbs <w.d.hubbs@gmail.com> | ||||
| @@ -1364,3 +1030,403 @@ Commit: William Hubbs <w.d.hubbs@gmail.com> | ||||
|     This fixes #196. | ||||
|      | ||||
|     [1] https://elkano.org/blog/manage-interface-bondings-sysfs-interface/ | ||||
|  | ||||
| commit 7affff568a0aa83d732757c4699d4b94b7e3a9aa | ||||
| Author: William Hubbs <w.d.hubbs@gmail.com> | ||||
| Commit: William Hubbs <w.d.hubbs@gmail.com> | ||||
|  | ||||
|     init.d.examples: pid files always go in /var | ||||
|      | ||||
|     This removes the @VARBASE@ substitution since it is always translated to | ||||
|     /var. | ||||
|  | ||||
| commit 4f750933fd8ef944be58bfeef071a8e35fc0c606 | ||||
| Author: William Hubbs <w.d.hubbs@gmail.com> | ||||
| Commit: William Hubbs <w.d.hubbs@gmail.com> | ||||
|  | ||||
|     procfs: remove the @sysconfdir@ reference | ||||
|  | ||||
| commit 50b69d564a8f89b8137bb6d9d53aac1e44f6c23c | ||||
| Author: William Hubbs <w.d.hubbs@gmail.com> | ||||
| Commit: William Hubbs <w.d.hubbs@gmail.com> | ||||
|  | ||||
|     hostname: replace @SYSCONFDIR@ references with /etc | ||||
|      | ||||
|     I do not know of any situation where /etc/hostname is at any other | ||||
|     location. Also, this does not run on prefix. | ||||
|  | ||||
| commit eb18f4f3483b99705f944c7274b4a6b451716df7 | ||||
| Author: William Hubbs <w.d.hubbs@gmail.com> | ||||
| Commit: William Hubbs <w.d.hubbs@gmail.com> | ||||
|  | ||||
|     hwclock: use shell variables for configuration file path | ||||
|      | ||||
|     This removes a reference to @SYSCONFDIR@. | ||||
|  | ||||
| commit d5f3fe52c87928095bd2659823b985d231f0718c | ||||
| Author: William Hubbs <w.d.hubbs@gmail.com> | ||||
| Commit: William Hubbs <w.d.hubbs@gmail.com> | ||||
|  | ||||
|     sysctl: hard code paths for sysctl files on *bsd | ||||
|      | ||||
|     For *BSD,the sysctl*.conf files are always in /etc. | ||||
|  | ||||
| commit bb1bc6eeb73b3483a1ebdfc142a11240b58588cf | ||||
| Author: William Hubbs <w.d.hubbs@gmail.com> | ||||
| Commit: William Hubbs <w.d.hubbs@gmail.com> | ||||
|  | ||||
|     local: misc cleanups | ||||
|      | ||||
|     Remove references to @SYSCONFDIR@ since these can be calculated at | ||||
|     runtime. | ||||
|     Also style fixes. | ||||
|  | ||||
| commit 53844fd0dcd9741b5f19dee7c00787be7e904c3c | ||||
| Author: William Hubbs <w.d.hubbs@gmail.com> | ||||
| Commit: William Hubbs <w.d.hubbs@gmail.com> | ||||
|  | ||||
|     devfs: cleanup | ||||
|      | ||||
|     clean up local definitions. Also remove @SYSCONFDIR@ substitutions since | ||||
|     they can be calculated at runtime. | ||||
|  | ||||
| commit 14938c29cefe869872b987f8e606da72024fa8bb | ||||
| Author: bell07 <web.alexander@web.de> | ||||
| Commit: William Hubbs <w.d.hubbs@gmail.com> | ||||
|  | ||||
|     net-online: wait for ping_test_host | ||||
|      | ||||
|     The script should wait till the ping host is available or timeout reached | ||||
|     Closes : #179 | ||||
|     Closes : #191 | ||||
|  | ||||
| commit 8bf501aaf2cb60b8ddf1b2fa2d1ba0ef970fb790 | ||||
| Author: William Hubbs <w.d.hubbs@gmail.com> | ||||
| Commit: William Hubbs <w.d.hubbs@gmail.com> | ||||
|  | ||||
|     network: use 'command -v ip' to test for the ip executable | ||||
|      | ||||
|     This is an improved test because it doesn't require the ip executable to be | ||||
|     in a specific path. | ||||
|  | ||||
| commit 9d05f68b51d7b31634cde30a482ec0e3da3b1c21 | ||||
| Author: William Hubbs <w.d.hubbs@gmail.com> | ||||
| Commit: William Hubbs <w.d.hubbs@gmail.com> | ||||
|  | ||||
|     Do not use file tests in net-online | ||||
|      | ||||
|     https://unix.stackexchange.com/questions/252002/help-testing-special-file-in-sys-class-net | ||||
|      | ||||
|     This is for #189 | ||||
|  | ||||
| commit ee2524cd1d0305e207f7dfac52742a1d5e77ea4a | ||||
| Author: William Hubbs <w.d.hubbs@gmail.com> | ||||
| Commit: William Hubbs <w.d.hubbs@gmail.com> | ||||
|  | ||||
|     net-online: clean up quoting and test for existence | ||||
|      | ||||
|     This is for #178. | ||||
|  | ||||
| commit 5c81661d4758dea039860ae2481476a70e78ac47 | ||||
| Author: Marcel Greter <marcel.greter@ocbnet.ch> | ||||
| Commit: William Hubbs <w.d.hubbs@gmail.com> | ||||
|  | ||||
|     Gracefully handle unreadable /sys/class/net/dev/ nodes | ||||
|      | ||||
|     Fixes https://bugs.gentoo.org/629228 | ||||
|     Fixes #189 | ||||
|     Fixes #185 | ||||
|     Fixes #178 | ||||
|  | ||||
| commit fb96c9c127dcfa932460b0e8a977ba5f7d26a418 | ||||
| Author: William Hubbs <w.d.hubbs@gmail.com> | ||||
| Commit: William Hubbs <w.d.hubbs@gmail.com> | ||||
|  | ||||
|     Make bash-completion and zsh-completion optional | ||||
|  | ||||
| commit 6c456f9383ab0000527b4363bc82fc17850aba18 | ||||
| Author: William Hubbs <w.d.hubbs@gmail.com> | ||||
| Commit: William Hubbs <w.d.hubbs@gmail.com> | ||||
|  | ||||
|     Add zsh-completion support | ||||
|  | ||||
| commit d220fc272337b216bff6ac781a7b6be4e6f3caee | ||||
| Author: William Hubbs <w.d.hubbs@gmail.com> | ||||
| Commit: William Hubbs <w.d.hubbs@gmail.com> | ||||
|  | ||||
|     add bash completion support | ||||
|      | ||||
|     This fixes #188. | ||||
|  | ||||
| commit a2447dfb420cbd97a65cc085404c031d42cb3dfb | ||||
| Author: William Hubbs <w.d.hubbs@gmail.com> | ||||
| Commit: William Hubbs <w.d.hubbs@gmail.com> | ||||
|  | ||||
|     rc-service: add --ifcrashed option | ||||
|      | ||||
|     This works like the other --if options. If the service is crashed, run | ||||
|     the command. | ||||
|      | ||||
|     This fixes #154. | ||||
|  | ||||
| commit cee3919908c2d715fd75a796873e3308209a4c2e | ||||
| Author: William Hubbs <w.d.hubbs@gmail.com> | ||||
| Commit: William Hubbs <w.d.hubbs@gmail.com> | ||||
|  | ||||
|     Clean up the calls to group_add_service | ||||
|      | ||||
|     This function should only be called once and it does not take any | ||||
|     arguments. | ||||
|      | ||||
|     X-Gentoo-Bug: 639166 | ||||
|     X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=639166 | ||||
|  | ||||
| commit 0feadd2922484ec181c2ab86a5f7f8d6d37c5c77 | ||||
| Author: William Hubbs <w.d.hubbs@gmail.com> | ||||
| Commit: William Hubbs <w.d.hubbs@gmail.com> | ||||
|  | ||||
|     man/openrc-run.8: update documentation for command_user | ||||
|  | ||||
| commit a7c99506d9de81b9a2a7547bd11715073de1ce95 | ||||
| Author: Will Miles <wmiles@sgl.com> | ||||
| Commit: William Hubbs <w.d.hubbs@gmail.com> | ||||
|  | ||||
|     Fix repeated dependency cache rebuild if clock skewed | ||||
|      | ||||
|     rc_deptree_update_needed would return early as soon as it found | ||||
|     any file newer than the existing dependency cache.  Unfortunately, | ||||
|     the first file found may not be the newest one there; so the | ||||
|     clock skew workaround in rc-misc:_rc_deptree_load would be given | ||||
|     a timestamp that was still too old. | ||||
|      | ||||
|     This fix forces a full scan of all relevant files, so as to | ||||
|     ensure that we return a timestamp that will allow the clock skew | ||||
|     fix to operate.   The runtime cost is no worse than the case where | ||||
|     the cache is up to date (ie. we must check every possible file). | ||||
|      | ||||
|     This fixes #161. | ||||
|  | ||||
| commit f0129307759f1a5eb34b72589e8d48790c92b2db | ||||
| Author: Julien Reichardt <mi@jrei.ch> | ||||
| Commit: William Hubbs <w.d.hubbs@gmail.com> | ||||
|  | ||||
|     man/openrc-run.8: remove white space | ||||
|      | ||||
|     This is for #184. | ||||
|  | ||||
| commit ddbdb696582e9fd61995f15d6a3a53055a151e41 | ||||
| Author: Julien Reichardt <mi@jrei.ch> | ||||
| Commit: William Hubbs <w.d.hubbs@gmail.com> | ||||
|  | ||||
|     add more variables for start-stop-daemon and supervise-daemon options | ||||
|      | ||||
|     Add the following variables to expose more arguments that can be passed | ||||
|     to start-stop-daemon or supervise-daemon: | ||||
|      | ||||
|     - directory will be passed to --chdir | ||||
|     - error_log will be passed to --stderr | ||||
|     - output_log will be passed to --stdout | ||||
|     - umask will be passed to umask | ||||
|      | ||||
|     This is for #184. | ||||
|  | ||||
| commit c84ebb94d19ca856fe064e15d2068d5671e360c9 | ||||
| Author: Doug Freed <dwfreed@mtu.edu> | ||||
| Commit: GitHub <noreply@github.com> | ||||
|  | ||||
|     start-stop-daemon: properly handle missing pidfile | ||||
|      | ||||
|     X-Gentoo-Bug: 639218 | ||||
|     X-Gentoo-Bug-URL: https://bugs.gentoo.org/639218 | ||||
|  | ||||
| commit 3de6395ae3b8780ab501f3cf8688e1cb2a9f0243 | ||||
| Author: William Hubbs <w.d.hubbs@gmail.com> | ||||
| Commit: William Hubbs <w.d.hubbs@gmail.com> | ||||
|  | ||||
|     split cgroups mounting out of sysfs | ||||
|      | ||||
|     This is neceessary to allow cgroups to be mounted in an lxc/lxd | ||||
|     container. | ||||
|      | ||||
|     Fixes https://github.com/openrc/openrc/issues/187 | ||||
|  | ||||
| commit 6bb7ebec483a96e258c64ea3fea18358d7893fee | ||||
| Author: William Hubbs <w.d.hubbs@gmail.com> | ||||
| Commit: William Hubbs <w.d.hubbs@gmail.com> | ||||
|  | ||||
|     fix FreeBSD build | ||||
|      | ||||
|     This is for #186. | ||||
|  | ||||
| commit a192caf88f527e09508e32baa623ef85549612ae | ||||
| Author: Doug Freed <dwfreed@mtu.edu> | ||||
| Commit: Doug Freed <dwfreed@mtu.edu> | ||||
|  | ||||
|     rc-schedules: if given nothing to look for, stop | ||||
|      | ||||
|     This avoids trying to kill everything. | ||||
|      | ||||
|     X-Gentoo-Bug: 631958 | ||||
|     X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=631958 | ||||
|  | ||||
| commit e805c74d31113c75058d860588e83bca120decf6 | ||||
| Author: William Hubbs <w.d.hubbs@gmail.com> | ||||
| Commit: William Hubbs <w.d.hubbs@gmail.com> | ||||
|  | ||||
|     s6 supervisor fixes | ||||
|      | ||||
|     Add the ability to force-kill a service if it does not go down | ||||
|     successfully. Also, adjust the default wait time for an s6 service to go | ||||
|     down to 60 seconds. | ||||
|  | ||||
| commit 318e87348168e37d78f433d3ff06288ad8ccf15c | ||||
| Author: William Hubbs <w.d.hubbs@gmail.com> | ||||
| Commit: William Hubbs <w.d.hubbs@gmail.com> | ||||
|  | ||||
|     strongly encourage Linux users to not make  /etc/mtab a flat file | ||||
|      | ||||
|     The OpenRC team does not currently know of any modern linux tools that | ||||
|     require /etc/mtab to be a flat file, so this puts users on notice that | ||||
|     the mtab service will be removed in the future. | ||||
|  | ||||
| commit 0d15898f58cc254d79777c791d4798a9b2542cf2 | ||||
| Author: William Hubbs <w.d.hubbs@gmail.com> | ||||
| Commit: William Hubbs <w.d.hubbs@gmail.com> | ||||
|  | ||||
|     adjust mtab and localmount dependencies | ||||
|      | ||||
|     localmount had mtab in its "use" dependencies; however, it makes more | ||||
|     sense to add "before localmount" to the mtab service and remove | ||||
|     "use mtab" from the localmount service. | ||||
|  | ||||
| commit 971e82784cd1ad8f9a286ee792e6417359972976 | ||||
| Author: William Hubbs <w.d.hubbs@gmail.com> | ||||
| Commit: William Hubbs <w.d.hubbs@gmail.com> | ||||
|  | ||||
|     rc_find_pids: namespace fix | ||||
|      | ||||
|     Ignore namespaces if there are errors reading either the pid namespace | ||||
|     for the current process or the process we aare testing. | ||||
|      | ||||
|     This fixes https://github.com/openrc/openrc/issues/180. | ||||
|  | ||||
| commit 90d9ea656ff7c6b5d618df4e4261ebfa4033f1a8 | ||||
| Author: William Hubbs <w.d.hubbs@gmail.com> | ||||
| Commit: William Hubbs <w.d.hubbs@gmail.com> | ||||
|  | ||||
|     start-stop-daemon: do not use do_stop to verify whether a daemon is running | ||||
|      | ||||
|     X-Gentoo-Bug: 636574 | ||||
|     X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=636574 | ||||
|  | ||||
| commit a3d1c8a0e7d5586be13e2cd9b5029fd729bc1594 | ||||
| Author: William Hubbs <w.d.hubbs@gmail.com> | ||||
| Commit: William Hubbs <w.d.hubbs@gmail.com> | ||||
|  | ||||
|     fix issue with --reexec call | ||||
|  | ||||
| commit 913b2ca53771742385d5c69164aefcaab634f012 | ||||
| Author: William Hubbs <w.d.hubbs@gmail.com> | ||||
| Commit: William Hubbs <w.d.hubbs@gmail.com> | ||||
|  | ||||
|     supervise-daemon: use RC_SVCNAME as the first argument to the daemon | ||||
|      | ||||
|     This makes ps show which service the supervisor is monitoring. | ||||
|  | ||||
| commit 3fe99c8b8264269dd935d52a1a52581cc0f14e8e | ||||
| Author: William Hubbs <w.d.hubbs@gmail.com> | ||||
| Commit: William Hubbs <w.d.hubbs@gmail.com> | ||||
|  | ||||
|     supervise-daemon: fix logging for reexec and the child command line | ||||
|  | ||||
| commit 27b8183de2f2bfd7411c14c1ec28543ca8a36602 | ||||
| Author: William Hubbs <w.d.hubbs@gmail.com> | ||||
| Commit: William Hubbs <w.d.hubbs@gmail.com> | ||||
|  | ||||
|     log as supervise-daemon not the service | ||||
|  | ||||
| commit f32d8e1bfe16caf233d1180921f4aeed77d7476d | ||||
| Author: William Hubbs <w.d.hubbs@gmail.com> | ||||
| Commit: William Hubbs <w.d.hubbs@gmail.com> | ||||
|  | ||||
|     supervise-daemon: clarify a log message | ||||
|  | ||||
| commit d019f34a83b0ad5e890f685b1263b281ab54ce54 | ||||
| Author: William Hubbs <w.d.hubbs@gmail.com> | ||||
| Commit: William Hubbs <w.d.hubbs@gmail.com> | ||||
|  | ||||
|     supervise-daemon: log the command line we run to spawn the child process | ||||
|  | ||||
| commit bb9c481f02cb1843e00bf32e98caf18b6b56bb4d | ||||
| Author: William Hubbs <w.d.hubbs@gmail.com> | ||||
| Commit: William Hubbs <w.d.hubbs@gmail.com> | ||||
|  | ||||
|     supervise-daemon: log with the service name instead of "supervise-daemon" | ||||
|  | ||||
| commit 82da844b42ff83b2ebf944198e56ac2d81851897 | ||||
| Author: William Hubbs <w.d.hubbs@gmail.com> | ||||
| Commit: William Hubbs <w.d.hubbs@gmail.com> | ||||
|  | ||||
|     implement "unsupervised" status | ||||
|      | ||||
|     The unsupervised status is to be used when a supervisor of a supervised | ||||
|     service dies but leaves the service daemon itself running. | ||||
|  | ||||
| commit 667a09983ca5311824aa88c42d39a495c540fc4c | ||||
| Author: William Hubbs <w.d.hubbs@gmail.com> | ||||
| Commit: William Hubbs <w.d.hubbs@gmail.com> | ||||
|  | ||||
|     supervise-daemon: remove child_pid from saved options during shutdown | ||||
|      | ||||
|     This allows us to detect when the supervisor dies unexpectedly because | ||||
|     in that case child_pid will still exist. | ||||
|  | ||||
| commit cf429ee359356d736c818e8b35db8fca887e7332 | ||||
| Author: William Hubbs <w.d.hubbs@gmail.com> | ||||
| Commit: William Hubbs <w.d.hubbs@gmail.com> | ||||
|  | ||||
|     rc_service_value_set: remove the option if NULL is the value | ||||
|      | ||||
|     This allows the equivalent of "unsetting" a value for a service. | ||||
|  | ||||
| commit 6f3e2e2d7de61ab28cf03937ccf2e5f80b62190a | ||||
| Author: William Hubbs <w.d.hubbs@gmail.com> | ||||
| Commit: William Hubbs <w.d.hubbs@gmail.com> | ||||
|  | ||||
|     supervise-daemon.sh: fix status function with no namespaces | ||||
|  | ||||
| commit 35b88fb42bb8e0a56cdc1947342f1b89c98658bc | ||||
| Author: Patrick McLean <chutzpah@gentoo.org> | ||||
| Commit: William Hubbs <w.d.hubbs@gmail.com> | ||||
|  | ||||
|     cgroups_cleanup: clean up shutdown signaling | ||||
|      | ||||
|     - do not sleep for the full 90 seconds if processes are dead | ||||
|     - re-arrange the order of signals we attempt to send to the processes | ||||
|  | ||||
| commit a428c325a902bba55a849a07a59c0c1567404db2 | ||||
| Author: William Hubbs <w.d.hubbs@gmail.com> | ||||
| Commit: William Hubbs <w.d.hubbs@gmail.com> | ||||
|  | ||||
|     add "unsupervised" status and return code 64 to supervise-daemon status function | ||||
|      | ||||
|     This is to be used if the service is being supervised and the | ||||
|     supervisor is somehow killed. | ||||
|      | ||||
|     Currently, this is very linux specific, but I will expand to other | ||||
|     platforms, patches are welcome. | ||||
|  | ||||
| commit 3219ecd6085231d7cc1268323a5be6a69f8c9143 | ||||
| Author: William Hubbs <w.d.hubbs@gmail.com> | ||||
| Commit: William Hubbs <w.d.hubbs@gmail.com> | ||||
|  | ||||
|     supervise-daemon: fix build issue for >=glibc-2.26 | ||||
|      | ||||
|     X-Gentoo-Bug: 635334 | ||||
|     X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=635334 | ||||
|  | ||||
| commit 0d8dc4f798cc0d707fc64e8bffcba4fbceb32935 | ||||
| Author: William Hubbs <w.d.hubbs@gmail.com> | ||||
| Commit: William Hubbs <w.d.hubbs@gmail.com> | ||||
|  | ||||
|     version 0.35 | ||||
|   | ||||
| @@ -1,3 +1,3 @@ | ||||
| NAME=		openrc | ||||
| VERSION=	0.40.3 | ||||
| VERSION=	0.39.1 | ||||
| PKG=		${NAME}-${VERSION} | ||||
|   | ||||
							
								
								
									
										13
									
								
								NEWS.md
									
									
									
									
									
								
							
							
						
						
									
										13
									
								
								NEWS.md
									
									
									
									
									
								
							| @@ -4,19 +4,6 @@ OpenRC NEWS | ||||
| This file will contain a list of notable changes for each release. Note | ||||
| the information in this file is in reverse order. | ||||
|  | ||||
| ## OpenRC 0.40 | ||||
|  | ||||
| In this version, the keymaps and termencoding services on Linux needed | ||||
| to be modified so they do not write to the root file system. This was | ||||
| done so they can run earlier in the boot sequence. AS a result, you will | ||||
| need to add save-termencoding and save-keymaps to your boot runlevel. | ||||
| This can be done as follows: | ||||
|  | ||||
| ``` | ||||
| # rc-update add save-keymaps boot | ||||
| # rc-update add save-termencoding boot | ||||
| ``` | ||||
|  | ||||
| ## OpenRC 0.39 | ||||
|  | ||||
| This version removes the support for addons. | ||||
|   | ||||
| @@ -230,7 +230,7 @@ rc_tty_number=12 | ||||
| # The following setting turns on the memory.use_hierarchy setting in the | ||||
| # root memory cgroup for cgroups v1. | ||||
| # It must be set to yes in this file if you want this functionality. | ||||
| #rc_cgroup_memory_use_hierarchy="NO" | ||||
| #rc_cggroup_memory_use_hierarchy="NO" | ||||
|  | ||||
| # The following settings allow you to set up values for the cgroups version 1 | ||||
| # controllers for your services. | ||||
|   | ||||
							
								
								
									
										2
									
								
								init.d/.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								init.d/.gitignore
									
									
									
									
										vendored
									
									
								
							| @@ -41,8 +41,6 @@ rc-enabled | ||||
| rpcbind | ||||
| runsvdir | ||||
| savecore | ||||
| save-keymaps | ||||
| save-termencoding | ||||
| swap-blk | ||||
| swclock | ||||
| syslogd | ||||
|   | ||||
| @@ -23,8 +23,8 @@ SRCS-FreeBSD+=	adjkerntz.in devd.in dumpon.in encswap.in ipfw.in \ | ||||
|  | ||||
| SRCS-Linux=	agetty.in binfmt.in devfs.in cgroups.in dmesg.in hwclock.in \ | ||||
| 	consolefont.in keymaps.in killprocs.in modules.in \ | ||||
| 	mount-ro.in mtab.in numlock.in procfs.in net-online.in save-keymaps.in \ | ||||
| 	save-termencoding.in sysfs.in termencoding.in | ||||
| 	mount-ro.in mtab.in numlock.in procfs.in net-online.in sysfs.in \ | ||||
| termencoding.in | ||||
|  | ||||
| # Generic BSD scripts | ||||
| SRCS-NetBSD=	hostid.in moused.in newsyslog.in pf.in rarpd.in rc-enabled.in \ | ||||
|   | ||||
| @@ -12,7 +12,6 @@ | ||||
| description="start agetty on a terminal line" | ||||
| supervisor=supervise-daemon | ||||
| port="${RC_SVCNAME#*.}" | ||||
| respawn_period="${respawn_period:-60}" | ||||
| term_type="${term_type:-linux}" | ||||
| command=/sbin/agetty | ||||
| command_args_foreground="${agetty_options} ${port} ${baud} ${term_type}" | ||||
|   | ||||
| @@ -14,7 +14,7 @@ description="Applies a keymap for the consoles." | ||||
| depend() | ||||
| { | ||||
| 	need termencoding | ||||
| 	after devfs | ||||
| 	after bootmisc clock | ||||
| 	keyword -docker -lxc -openvz -prefix -systemd-nspawn -uml -vserver -xenu | ||||
| } | ||||
|  | ||||
| @@ -68,5 +68,10 @@ start() | ||||
| 		echo "altgr keycode 18 = U+20AC" | loadkeys -q - | ||||
| 		eend $? | ||||
| 	fi | ||||
| 	return 0 | ||||
|  | ||||
| 	# Save the keymapping for use immediately at boot | ||||
| 	if checkpath -W "$RC_LIBEXECDIR"; then | ||||
| 		mkdir -p "$RC_LIBEXECDIR"/console | ||||
| 		dumpkeys >"$RC_LIBEXECDIR"/console/keymap | ||||
| 	fi | ||||
| } | ||||
|   | ||||
| @@ -1,28 +0,0 @@ | ||||
| #!@SBINDIR@/openrc-run | ||||
| # Copyright (c) 2018 Sony Interactive Entertainment, Inc. | ||||
| # | ||||
| # This file is part of OpenRC. It is subject to the license terms in | ||||
| # the LICENSE file found in the top-level directory of this | ||||
| # distribution and at https://github.com/OpenRC/openrc/blob/master/LICENSE | ||||
| # This file may not be copied, modified, propagated, or distributed | ||||
| # except according to the terms contained in the LICENSE file. | ||||
|  | ||||
| description="Save the keymap for use as early as possible" | ||||
|  | ||||
| depend() | ||||
| { | ||||
| 	need termencoding | ||||
| 	after bootmisc clock keymaps | ||||
| 	keyword -docker -lxc -openvz -prefix -systemd-nspawn -uml -vserver -xenu | ||||
| } | ||||
|  | ||||
| start() | ||||
| { | ||||
| 	# Save the keymapping for use immediately at boot | ||||
| 	ebegin "Saving key mapping" | ||||
| 	if checkpath -W "$RC_LIBEXECDIR"; then | ||||
| 		mkdir -p "$RC_LIBEXECDIR"/console | ||||
| 		dumpkeys >"$RC_LIBEXECDIR"/console/keymap | ||||
| 	fi | ||||
| 	eend $? "Unable to save keymapping" | ||||
| } | ||||
| @@ -1,35 +0,0 @@ | ||||
| #!@SBINDIR@/openrc-run | ||||
| # Copyright (c) 2018 Sony Interactive Entertainment, Inc. | ||||
| # | ||||
| # This file is part of OpenRC. It is subject to the license terms in | ||||
| # the LICENSE file found in the top-level directory of this | ||||
| # distribution and at https://github.com/OpenRC/openrc/blob/master/LICENSE | ||||
| # This file may not be copied, modified, propagated, or distributed | ||||
| # except according to the terms contained in the LICENSE file. | ||||
|  | ||||
| description="Configures terminal encoding." | ||||
|  | ||||
| ttyn=${rc_tty_number:-${RC_TTY_NUMBER:-12}} | ||||
| : ${unicode:=${UNICODE}} | ||||
|  | ||||
| depend() | ||||
| { | ||||
| 	keyword -docker -lxc -openvz -prefix -systemd-nspawn -uml -vserver -xenu | ||||
| 	use root | ||||
| 	after bootmisc clock termencoding | ||||
| } | ||||
|  | ||||
| start() | ||||
| { | ||||
| 	ebegin "Saving terminal encoding" | ||||
| 	# Save the encoding for use immediately at boot | ||||
| 	if checkpath -W "$RC_LIBEXECDIR"; then | ||||
| 		mkdir -p "$RC_LIBEXECDIR"/console | ||||
| 		if yesno ${unicode:-${UNICODE}}; then | ||||
| 			echo "" > "$RC_LIBEXECDIR"/console/unicode | ||||
| 		else | ||||
| 			rm -f "$RC_LIBEXECDIR"/console/unicode | ||||
| 		fi | ||||
| 	fi | ||||
| 	eend 0 | ||||
| } | ||||
| @@ -17,7 +17,8 @@ ttyn=${rc_tty_number:-${RC_TTY_NUMBER:-12}} | ||||
| depend() | ||||
| { | ||||
| 	keyword -docker -lxc -openvz -prefix -systemd-nspawn -uml -vserver -xenu | ||||
| 	after devfs | ||||
| 	use root | ||||
| 	after bootmisc clock | ||||
| } | ||||
|  | ||||
| start() | ||||
|   | ||||
| @@ -43,8 +43,6 @@ List all defined runlevels. | ||||
| Show all manually started services. | ||||
| .It Fl r , -runlevel | ||||
| Print the current runlevel name. | ||||
| .It Fl S , -supervised | ||||
| Show all supervised services. | ||||
| .It Fl s , -servicelist | ||||
| Show all services. | ||||
| .It Fl u , -unused | ||||
|   | ||||
| @@ -16,7 +16,6 @@ | ||||
| .Nd starts a daemon and restarts it if it crashes | ||||
| .Sh SYNOPSIS | ||||
| .Nm | ||||
| servicename | ||||
| .Fl a , -healthcheck-timer | ||||
| .Ar seconds | ||||
| .Fl A , -healthcheck-delay | ||||
| @@ -37,6 +36,8 @@ servicename | ||||
| .Ar count | ||||
| .Fl N , -nicelevel | ||||
| .Ar level | ||||
| .Fl p , -pidfile | ||||
| .Ar pidfile | ||||
| .Fl P , -respawn-period | ||||
| .Ar seconds | ||||
| .Fl R , -retry | ||||
| @@ -54,15 +55,10 @@ servicename | ||||
| .Op Fl - | ||||
| .Op Ar arguments | ||||
| .Nm | ||||
| servicename | ||||
| .Fl K , -stop | ||||
| .Ar daemon | ||||
| .Fl r , -chroot | ||||
| .Ar chrootpath | ||||
| .Nm | ||||
| servicename | ||||
| .Fl s , -signal | ||||
| .Ar signal | ||||
| .Fl p , -pidfile | ||||
| .Ar pidfile | ||||
| .Fl r , -chroot | ||||
| .Ar chrootpath | ||||
| .Sh DESCRIPTION | ||||
| @@ -70,15 +66,22 @@ servicename | ||||
| provides a consistent method of starting, stopping and restarting | ||||
| daemons. If | ||||
| .Fl K , -stop | ||||
| or | ||||
| .Fl s , -signal | ||||
| is not provided, then we assume we are starting the daemon. | ||||
| .Nm | ||||
| only works with daemons which do not fork. If your daemon has options to | ||||
| tell it not to fork, it should be configured to not fork. | ||||
| only works with daemons which do not fork. Also, it uses its own pid | ||||
| file, so the daemon should not write a pid file, or the pid file passed | ||||
| to  | ||||
| .Nm | ||||
| should not be the one the daemon writes. | ||||
| .Pp | ||||
| Here are the options to specify the daemon and how it should start or stop: | ||||
| .Bl -tag -width indent | ||||
| .It Fl p , -pidfile Ar pidfile | ||||
| When starting, we write a | ||||
| .Ar pidfile | ||||
| so we know which supervisor to stop.  When stopping we only stop the pid(s) | ||||
| listed in the | ||||
| .Ar pidfile . | ||||
| .It Fl u , -user Ar user Ns Op : Ns Ar group | ||||
| Start the daemon as the | ||||
| .Ar user | ||||
| @@ -112,19 +115,16 @@ Data can be from 0 to 7 inclusive. | ||||
| .It Fl k , -umask Ar mode | ||||
| Set the umask of the daemon. | ||||
| .It Fl m , -respawn-max Ar count | ||||
| Sets the maximum number of times a daemon will be respawned. If a daemon | ||||
| crashes more than this number of times, | ||||
| Sets the maximum number of times a daemon will be respawned during a | ||||
| respawn period. If a daemon dies more than this number of times during a | ||||
| respawn period, | ||||
| .Nm | ||||
| will give up and exit. The default is 10 and 0 means unlimited. | ||||
| .Pp | ||||
| If respawn-period is also set, more than respawn-max crashes must occur | ||||
| during respawn-period seconds to cause | ||||
| .Nm | ||||
| to give up and exit. | ||||
| will give up trying to respawn it and exit. The default is 10, and 0 | ||||
| means unlimited. | ||||
| .It Fl N , -nicelevel Ar level | ||||
| Modifies the scheduling priority of the daemon. | ||||
| .It Fl P , -respawn-period Ar seconds | ||||
| Sets the length of a respawn period. See the | ||||
| Sets the length of a respawn period. The default is 10 seconds. See the | ||||
| description of --respawn-max for more information. | ||||
| .It Fl R , -retry Ar timeout | Ar signal Ns / Ns Ar timeout | ||||
| The retry specification can be either a timeout in seconds or multiple | ||||
| @@ -132,11 +132,7 @@ signal/timeout pairs (like SIGTERM/5). | ||||
| If this option is not given, the default is SIGTERM/5. | ||||
| .It Fl r , -chroot Ar path | ||||
| chroot to this directory before starting the daemon. All other paths, such | ||||
| as the path to the daemon and chdir should be relative to the chroot. | ||||
| .It Fl  , -signal Ar signal | ||||
| Instruct a supervisor to signal the process it is supervising. The | ||||
| process to communicate with is determined by the name of the service | ||||
| taken from the RC_SVCNAME environment variable. | ||||
| as the path to the daemon, chdir and pidfile, should be relative to the chroot. | ||||
| .It Fl u , -user Ar user | ||||
| Start the daemon as the specified user. | ||||
| .It Fl 1 , -stdout Ar logfile | ||||
| @@ -149,6 +145,7 @@ The same thing as | ||||
| .Fl 1 , -stdout | ||||
| but with the standard error output. | ||||
| .El | ||||
| .El | ||||
| .Sh ENVIRONMENT | ||||
| .Va SSD_NICELEVEL | ||||
| can also set the scheduling priority of the daemon, but the command line | ||||
| @@ -170,16 +167,15 @@ make sure the settings mmake sense. For example, a respawn period of 5 | ||||
| seconds with a respawn max of 10 and a respawn delay of 1 second leads | ||||
| to infinite respawning since there can never be 10 respawns within 5 | ||||
| seconds. | ||||
| .Sh NOTE | ||||
| Invoking supervise-daemon requires both the RC_SVCNAME  environment | ||||
| variable to be set and the name of the service as the first argument on | ||||
| the command line, so it is best to invoke it inside a service script | ||||
| rather than manually. | ||||
| .Sh SEE ALSO | ||||
| .Xr chdir 2 , | ||||
| .Xr chroot 2 , | ||||
| .Xr getopt 3 , | ||||
| .Xr nice 2 , | ||||
| .Xr rc_find_pids 3 | ||||
| .Sh BUGS | ||||
| .Nm | ||||
| cannot stop an interpreted daemon that no longer exists without a pidfile. | ||||
| .Sh HISTORY | ||||
| .Nm | ||||
| first appeared in Debian. | ||||
|   | ||||
| @@ -36,8 +36,7 @@ BOOT-FreeBSD+=	hostid modules newsyslog savecore syslogd | ||||
| # FreeBSD specific stuff | ||||
| BOOT-FreeBSD+=	adjkerntz dumpon syscons | ||||
|  | ||||
| BOOT-Linux+=	binfmt hwclock keymaps modules mtab procfs save-keymaps \ | ||||
| 	save-termencoding termencoding | ||||
| BOOT-Linux+=	binfmt hwclock keymaps modules mtab procfs termencoding | ||||
| SHUTDOWN-Linux=	killprocs mount-ro | ||||
| SYSINIT-Linux=	devfs cgroups dmesg sysfs | ||||
|  | ||||
|   | ||||
| @@ -46,7 +46,7 @@ yesno() | ||||
| 	case "$value" in | ||||
| 		[Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1) return 0;; | ||||
| 		[Nn][Oo]|[Ff][Aa][Ll][Ss][Ee]|[Oo][Ff][Ff]|0) return 1;; | ||||
| 		*) vewarn "\$$1 is not set properly"; return 2;; | ||||
| 		*) vewarn "\$$1 is not set properly"; return 1;; | ||||
| 	esac | ||||
| } | ||||
|  | ||||
|   | ||||
| @@ -55,9 +55,11 @@ supervise_stop() | ||||
| 	local startpidfile="$(service_get_value "pidfile")" | ||||
| 	chroot="${startchroot:-$chroot}" | ||||
| 	pidfile="${startpidfile:-$pidfile}" | ||||
| 	[ -n "$pidfile" ] || return 0 | ||||
| 	ebegin "Stopping ${name:-$RC_SVCNAME}" | ||||
| 	supervise-daemon "${RC_SVCNAME}" --stop \ | ||||
| 		${pidfile:+--pidfile} $chroot$pidfile | ||||
| 		${pidfile:+--pidfile} $chroot$pidfile \ | ||||
| 		${stopsig:+--signal} $stopsig | ||||
|  | ||||
| 	eend $? "Failed to stop ${name:-$RC_SVCNAME}" | ||||
| } | ||||
|   | ||||
| @@ -277,6 +277,7 @@ static RC_STRINGLIST *rc_config_kcl(RC_STRINGLIST *config) | ||||
| 	char *tmp = NULL; | ||||
| 	char *value = NULL; | ||||
| 	size_t varlen = 0; | ||||
| 	size_t len = 0; | ||||
|  | ||||
| 	overrides = rc_stringlist_new(); | ||||
|  | ||||
| @@ -294,6 +295,7 @@ static RC_STRINGLIST *rc_config_kcl(RC_STRINGLIST *config) | ||||
| 		} | ||||
|  | ||||
| 		if (value != NULL) { | ||||
| 			len = varlen + strlen(value) + 2; | ||||
| 			xasprintf(&tmp, "%s=%s", override->value, value); | ||||
| 		} | ||||
|  | ||||
|   | ||||
| @@ -4,7 +4,7 @@ | ||||
|  */ | ||||
|  | ||||
| /* | ||||
|  * Copyright 2018 Sony Interactive Entertainment Inc. | ||||
|  * Copyright 2018 Sony Interactive Entertainment Inc.  | ||||
|  * | ||||
|  * This file is part of OpenRC. It is subject to the license terms in | ||||
|  * the LICENSE file found in the top-level directory of this | ||||
| @@ -133,7 +133,7 @@ void broadcast(char *text) | ||||
| 	char *p; | ||||
| 	char *line = NULL; | ||||
| 	struct sigaction sa; | ||||
| 	volatile int fd; | ||||
| 	int fd; | ||||
| 	FILE *tp; | ||||
| 	int	flags; | ||||
| 	char *term = NULL; | ||||
| @@ -153,7 +153,7 @@ void broadcast(char *text) | ||||
| 	p = strchr(date, '\n'); | ||||
| 	if (p) | ||||
| 		*p = 0; | ||||
|  | ||||
| 	 | ||||
| 	xasprintf(&line, "\007\r\nBroadcast message from %s@%s %s(%s):\r\n\r\n", | ||||
| 			user, name.nodename, tty, date); | ||||
|  | ||||
| @@ -162,7 +162,7 @@ void broadcast(char *text) | ||||
| 	 */ | ||||
| 	if (fork() != 0) | ||||
| 		return; | ||||
|  | ||||
| 	 | ||||
| 	memset(&sa, 0, sizeof(sa)); | ||||
| 	sa.sa_handler = handler; | ||||
| 	sigemptyset(&sa.sa_mask); | ||||
|   | ||||
| @@ -1,5 +1,5 @@ | ||||
| /* | ||||
|  * Copyright 2018 Sony Interactive Entertainment Inc. | ||||
|  * Copyright 2018 Sony Interactive Entertainment Inc.  | ||||
|  * | ||||
|  * This file is part of OpenRC. It is subject to the license terms in | ||||
|  * the LICENSE file found in the top-level directory of this | ||||
|   | ||||
| @@ -31,10 +31,6 @@ | ||||
| #include <sys/reboot.h> | ||||
| #include <sys/wait.h> | ||||
|  | ||||
| #ifdef HAVE_SELINUX | ||||
| #  include <selinux/selinux.h> | ||||
| #endif | ||||
|  | ||||
| #include "helpers.h" | ||||
| #include "rc.h" | ||||
| #include "rc-wtmp.h" | ||||
| @@ -165,36 +161,10 @@ int main(int argc, char **argv) | ||||
| 	bool reexec = false; | ||||
| 	sigset_t signals; | ||||
| 	struct sigaction sa; | ||||
| #ifdef HAVE_SELINUX | ||||
| 	int			enforce = 0; | ||||
| #endif | ||||
|  | ||||
| 	if (getpid() != 1) | ||||
| 		return 1; | ||||
|  | ||||
| #ifdef HAVE_SELINUX | ||||
| 	if (getenv("SELINUX_INIT") == NULL) { | ||||
| 		if (is_selinux_enabled() != 1) { | ||||
| 			if (selinux_init_load_policy(&enforce) == 0) { | ||||
| 				putenv("SELINUX_INIT=YES"); | ||||
| 				execv(argv[0], argv); | ||||
| 			} else { | ||||
| 				if (enforce > 0) { | ||||
| 					/* | ||||
| 					 * SELinux in enforcing mode but load_policy failed | ||||
| 					 * At this point, we probably can't open /dev/console, | ||||
| 					 * so log() won't work | ||||
| 					 */ | ||||
| 					fprintf(stderr,"Unable to load SELinux Policy.\n"); | ||||
| 					fprintf(stderr,"Machine is  in enforcing mode.\n"); | ||||
| 					fprintf(stderr,"Halting now.\n"); | ||||
| 					exit(1); | ||||
| 				} | ||||
| 			} | ||||
| 		} | ||||
| 	} | ||||
| #endif | ||||
|  | ||||
| 	printf("OpenRC init version %s starting\n", VERSION); | ||||
|  | ||||
| 	if (argc > 1) | ||||
|   | ||||
| @@ -154,13 +154,15 @@ static void sleep_no_interrupt(int seconds) | ||||
| 	duration.tv_sec = seconds; | ||||
| 	duration.tv_nsec = 0; | ||||
|  | ||||
| 	while (nanosleep(&duration, &remaining) < 0 && errno == EINTR) | ||||
| 	while(nanosleep(&duration, &remaining) < 0 && errno == EINTR) | ||||
| 		duration = remaining; | ||||
| } | ||||
|  | ||||
| static void stop_shutdown(int sig) | ||||
| { | ||||
| 	(void) sig; | ||||
| 	/* use the sig parameter so the compiler will not complain */ | ||||
| 	if (sig == SIGINT) | ||||
| 		; | ||||
| 	unlink(nologin_file); | ||||
| 	unlink(shutdown_pid); | ||||
| einfo("Shutdown canceled"); | ||||
|   | ||||
| @@ -28,7 +28,6 @@ | ||||
| #include <stdio.h> | ||||
| #include <stdlib.h> | ||||
| #include <string.h> | ||||
| #include <syslog.h> | ||||
| #include <time.h> | ||||
| #include <unistd.h> | ||||
| #include <sys/stat.h> | ||||
| @@ -271,11 +270,8 @@ int do_stop(const char *applet, const char *exec, const char *const *argv, | ||||
| 			einfo("Would send signal %d to PID %d", sig, pi->pid); | ||||
| 			nkilled++; | ||||
| 		} else { | ||||
| 			if (sig) { | ||||
| 				syslog(LOG_DEBUG, "Sending signal %d to PID %d", sig, pi->pid); | ||||
| 				if (!quiet) | ||||
| 					ebeginv("Sending signal %d to PID %d", sig, pi->pid); | ||||
| 			} | ||||
| 			if (!quiet) | ||||
| 				ebeginv("Sending signal %d to PID %d", sig, pi->pid); | ||||
| 			errno = 0; | ||||
| 			killed = (kill(pi->pid, sig) == 0 || | ||||
| 			    errno == ESRCH ? true : false); | ||||
| @@ -283,9 +279,6 @@ int do_stop(const char *applet, const char *exec, const char *const *argv, | ||||
| 				eendv(killed ? 0 : 1, | ||||
| 				"%s: failed to send signal %d to PID %d: %s", | ||||
| 				applet, sig, pi->pid, strerror(errno)); | ||||
| 			else if (!killed) | ||||
| 				syslog(LOG_ERR, "Failed to send signal %d to PID %d: %s", | ||||
| 						sig, pi->pid, strerror(errno)); | ||||
| 			if (!killed) { | ||||
| 				nkilled = -1; | ||||
| 			} else { | ||||
| @@ -317,18 +310,12 @@ int run_stop_schedule(const char *applet, | ||||
| 	if (!(pid > 0 || exec || uid || (argv && *argv))) | ||||
| 		return 0; | ||||
|  | ||||
| 	if (exec) { | ||||
| 	if (exec) | ||||
| 		einfov("Will stop %s", exec); | ||||
| 		syslog(LOG_DEBUG, "Will stop %s", exec); | ||||
| 	} | ||||
| 	if (pid > 0) { | ||||
| 	if (pid > 0) | ||||
| 		einfov("Will stop PID %d", pid); | ||||
| 		syslog(LOG_DEBUG, "Will stop PID %d", pid); | ||||
| 	} | ||||
| 	if (uid) { | ||||
| 	if (uid) | ||||
| 		einfov("Will stop processes owned by UID %d", uid); | ||||
| 		syslog(LOG_DEBUG, "Will stop processes owned by UID %d", uid); | ||||
| 	} | ||||
| 	if (argv && *argv) { | ||||
| 		einfovn("Will stop processes of `"); | ||||
| 		if (rc_yesno(getenv("EINFO_VERBOSE"))) { | ||||
| @@ -389,7 +376,10 @@ int run_stop_schedule(const char *applet, | ||||
| 							printf("\n"); | ||||
| 							progressed = false; | ||||
| 						} | ||||
| 						if (errno != EINTR) { | ||||
| 						if (errno == EINTR) | ||||
| 							eerror("%s: caught an" | ||||
| 							    " interrupt", applet); | ||||
| 						else { | ||||
| 							eerror("%s: nanosleep: %s", | ||||
| 							    applet, strerror(errno)); | ||||
| 							return 0; | ||||
|   | ||||
| @@ -49,12 +49,10 @@ const char * const longopts_help[] = { | ||||
| 	"set xtrace when running the command", | ||||
| 	"ignore dependencies", | ||||
| 	"tests if the service exists or not", | ||||
| 	"if the service is crashed run the command", | ||||
| 	"if the service exists run the command", | ||||
| 	"if the service is inactive run the command", | ||||
| 	"if the service is not started run the command", | ||||
| 	"if the service is started run the command", | ||||
| 	"if the service is stopped run the command", | ||||
| 	"if the service is crashed then run the command", | ||||
| 	"if the service exists then run the command", | ||||
| 	"if the service is inactive then run the command", | ||||
| 	"if the service is not started then run the command", | ||||
| 	"list all available services", | ||||
| 	"resolve the service name to an init script", | ||||
| 	"dry run (show what would happen)", | ||||
|   | ||||
| @@ -29,7 +29,7 @@ | ||||
|  | ||||
| const char *applet = NULL; | ||||
| const char *extraopts = NULL; | ||||
| const char *getoptstring = "aclmrsSu" getoptstring_COMMON; | ||||
| const char *getoptstring = "aclmrsu" getoptstring_COMMON; | ||||
| const struct option longopts[] = { | ||||
| 	{"all",         0, NULL, 'a'}, | ||||
| 	{"crashed",     0, NULL, 'c'}, | ||||
| @@ -37,7 +37,6 @@ const struct option longopts[] = { | ||||
| 	{"manual",        0, NULL, 'm'}, | ||||
| 	{"runlevel",    0, NULL, 'r'}, | ||||
| 	{"servicelist", 0, NULL, 's'}, | ||||
| 	{"supervised", 0, NULL, 'S'}, | ||||
| 	{"unused",      0, NULL, 'u'}, | ||||
| 	longopts_COMMON | ||||
| }; | ||||
| @@ -48,7 +47,6 @@ const char * const longopts_help[] = { | ||||
| 	"Show manually started services", | ||||
| 	"Show the name of the current runlevel", | ||||
| 	"Show service list", | ||||
| 	"show supervised services", | ||||
| 	"Show services not assigned to any runlevel", | ||||
| 	longopts_help_COMMON | ||||
| }; | ||||
| @@ -169,9 +167,6 @@ print_service(const char *service) | ||||
| 	} else if (state & RC_SERVICE_SCHEDULED) { | ||||
| 		xasprintf(&status, "scheduled"); | ||||
| 		color = ECOLOR_WARN; | ||||
| 	} else if (state & RC_SERVICE_FAILED) { | ||||
| 		xasprintf(&status, "failed"); | ||||
| 		color = ECOLOR_WARN; | ||||
| 	} else | ||||
| 		xasprintf(&status, " stopped "); | ||||
|  | ||||
| @@ -243,7 +238,6 @@ print_stacked_services(const char *runlevel) | ||||
|  | ||||
| int main(int argc, char **argv) | ||||
| { | ||||
| 	RC_SERVICE state; | ||||
|     RC_STRING *s, *l, *t, *level; | ||||
| 	bool show_all = false; | ||||
| 	char *p, *runlevel = NULL; | ||||
| @@ -298,14 +292,6 @@ int main(int argc, char **argv) | ||||
| 			printf("%s\n", runlevel); | ||||
| 			goto exit; | ||||
| 			/* NOTREACHED */ | ||||
| 		case 'S': | ||||
| 			services = rc_services_in_state(RC_SERVICE_STARTED); | ||||
| 			TAILQ_FOREACH_SAFE(s, services, entries, t) | ||||
| 				if (!rc_service_value_get(s->value, "child_pid")) | ||||
| 					TAILQ_REMOVE(services, s, entries); | ||||
| 			print_services(NULL, services); | ||||
| 			goto exit; | ||||
| 			/* NOTREACHED */ | ||||
| 		case 's': | ||||
| 			services = rc_services_in_runlevel(NULL); | ||||
| 			print_services(NULL, services); | ||||
| @@ -387,14 +373,11 @@ int main(int argc, char **argv) | ||||
| 			free(nservices); | ||||
| 		} | ||||
| 		TAILQ_FOREACH_SAFE(s, services, entries, t) { | ||||
| 			state = rc_service_state(s->value); | ||||
| 			if ((rc_stringlist_find(sservices, s->value) || | ||||
| 			    (state & ( RC_SERVICE_STOPPED | RC_SERVICE_HOTPLUGGED)))) { | ||||
| 				if (! (state & RC_SERVICE_FAILED)) { | ||||
| 					TAILQ_REMOVE(services, s, entries); | ||||
| 					free(s->value); | ||||
| 					free(s); | ||||
| 				} | ||||
| 			    (rc_service_state(s->value) & ( RC_SERVICE_STOPPED | RC_SERVICE_HOTPLUGGED)))) { | ||||
| 				TAILQ_REMOVE(services, s, entries); | ||||
| 				free(s->value); | ||||
| 				free(s); | ||||
| 			} | ||||
| 		} | ||||
| 		needsme = rc_stringlist_new(); | ||||
|   | ||||
| @@ -996,7 +996,9 @@ int main(int argc, char **argv) | ||||
| 		ts.tv_sec = start_wait / 1000; | ||||
| 		ts.tv_nsec = (start_wait % 1000) * ONE_MS; | ||||
| 		if (nanosleep(&ts, NULL) == -1) { | ||||
| 			if (errno != EINTR) { | ||||
| 			if (errno == EINTR) | ||||
| 				eerror("%s: caught an interrupt", applet); | ||||
| 			else { | ||||
| 				eerror("%s: nanosleep: %s", | ||||
| 				    applet, strerror(errno)); | ||||
| 				return 0; | ||||
|   | ||||
| @@ -68,7 +68,7 @@ static struct pam_conv conv = { NULL, NULL}; | ||||
|  | ||||
| const char *applet = NULL; | ||||
| const char *extraopts = NULL; | ||||
| const char *getoptstring = "A:a:D:d:e:g:H:I:Kk:m:N:p:R:r:s:Su:1:2:3" \ | ||||
| const char *getoptstring = "A:a:D:d:e:g:H:I:Kk:m:N:p:R:r:Su:1:2:3" \ | ||||
| 	getoptstring_COMMON; | ||||
| const struct option longopts[] = { | ||||
| 	{ "healthcheck-timer",        1, NULL, 'a'}, | ||||
| @@ -86,7 +86,6 @@ const struct option longopts[] = { | ||||
| 	{ "respawn-period",        1, NULL, 'P'}, | ||||
| 	{ "retry",       1, NULL, 'R'}, | ||||
| 	{ "chroot",       1, NULL, 'r'}, | ||||
| 	{ "signal",       1, NULL, 's'}, | ||||
| 	{ "start",        0, NULL, 'S'}, | ||||
| 	{ "user",         1, NULL, 'u'}, | ||||
| 	{ "stdout",       1, NULL, '1'}, | ||||
| @@ -110,7 +109,6 @@ const char * const longopts_help[] = { | ||||
| 	"Set respawn time period", | ||||
| 	"Retry schedule to use when stopping", | ||||
| 	"Chroot to this directory", | ||||
| 	"Send a signal to the daemon", | ||||
| 	"Start daemon", | ||||
| 	"Change the process user", | ||||
| 	"Redirect stdout to file", | ||||
| @@ -123,7 +121,6 @@ const char *usagestring = NULL; | ||||
| static int healthcheckdelay = 0; | ||||
| static int healthchecktimer = 0; | ||||
| static volatile sig_atomic_t do_healthcheck = 0; | ||||
| static volatile sig_atomic_t exiting = 0; | ||||
| static int nicelevel = 0; | ||||
| static int ionicec = -1; | ||||
| static int ioniced = 0; | ||||
| @@ -136,6 +133,7 @@ static int stdout_fd; | ||||
| static int stderr_fd; | ||||
| static char *redirect_stderr = NULL; | ||||
| static char *redirect_stdout = NULL; | ||||
| static bool exiting = false; | ||||
| #ifdef TIOCNOTTY | ||||
| static int tty_fd = -1; | ||||
| #endif | ||||
| @@ -143,9 +141,7 @@ static pid_t child_pid; | ||||
| static int respawn_count = 0; | ||||
| static int respawn_delay = 0; | ||||
| static int respawn_max = 10; | ||||
| static int respawn_period = 0; | ||||
| static char *fifopath = NULL; | ||||
| static int fifo_fd = 0; | ||||
| static int respawn_period = 5; | ||||
| static char *pidfile = NULL; | ||||
| static char *svcname = NULL; | ||||
|  | ||||
| @@ -184,32 +180,21 @@ static void re_exec_supervisor(void) | ||||
| static void handle_signal(int sig) | ||||
| { | ||||
| 	int serrno = errno; | ||||
| 	pid_t pid; | ||||
|  | ||||
| 	switch (sig) { | ||||
| 	case SIGALRM: | ||||
| 		do_healthcheck = 1; | ||||
| 		break; | ||||
| 	case SIGCHLD: | ||||
| 		if (exiting) | ||||
| 			while (waitpid((pid_t)(-1), NULL, WNOHANG) > 0) {} | ||||
| 		else { | ||||
| 			while ((pid = waitpid((pid_t)(-1), NULL, WNOHANG|WNOWAIT)) > 0) { | ||||
| 				if (pid == child_pid) | ||||
| 					break; | ||||
| 				pid = waitpid(pid, NULL, WNOHANG); | ||||
| 			} | ||||
| 		} | ||||
| 		break; | ||||
| 	case SIGTERM: | ||||
| 		exiting = 1; | ||||
| 		break; | ||||
| 	default: | ||||
| 		syslog(LOG_WARNING, "caught signal %d", sig); | ||||
| 		re_exec_supervisor(); | ||||
| 	} | ||||
| 	syslog(LOG_WARNING, "caught signal %d", sig); | ||||
|  | ||||
| 	if (sig == SIGTERM) | ||||
| 		exiting = true; | ||||
| 	/* Restore errno */ | ||||
| 	errno = serrno; | ||||
| 	if (! exiting) | ||||
| 		re_exec_supervisor(); | ||||
| } | ||||
|  | ||||
| static void healthcheck(int sig) | ||||
| { | ||||
| 	if (sig == SIGALRM) | ||||
| 		do_healthcheck = 1; | ||||
| } | ||||
|  | ||||
| static char * expand_home(const char *home, const char *path) | ||||
| @@ -267,56 +252,6 @@ static char *make_cmdline(char **argv) | ||||
| 	return cmdline; | ||||
| } | ||||
|  | ||||
| static pid_t exec_command(const char *cmd) | ||||
| { | ||||
| 	char *file; | ||||
| 	pid_t pid = -1; | ||||
| 	sigset_t full; | ||||
| 	sigset_t old; | ||||
| 	struct sigaction sa; | ||||
|  | ||||
| 	file = rc_service_resolve(svcname); | ||||
| 	if (!exists(file)) { | ||||
| 		free(file); | ||||
| 		return 0; | ||||
| 	} | ||||
|  | ||||
| 	/* We need to block signals until we have forked */ | ||||
| 	memset(&sa, 0, sizeof (sa)); | ||||
| 	sa.sa_handler = SIG_DFL; | ||||
| 	sigemptyset(&sa.sa_mask); | ||||
| 	sigfillset(&full); | ||||
| 	sigprocmask(SIG_SETMASK, &full, &old); | ||||
|  | ||||
| 	pid = fork(); | ||||
| 	if (pid == 0) { | ||||
| 		/* Restore default handlers */ | ||||
| 		sigaction(SIGCHLD, &sa, NULL); | ||||
| 		sigaction(SIGHUP, &sa, NULL); | ||||
| 		sigaction(SIGINT, &sa, NULL); | ||||
| 		sigaction(SIGQUIT, &sa, NULL); | ||||
| 		sigaction(SIGTERM, &sa, NULL); | ||||
| 		sigaction(SIGUSR1, &sa, NULL); | ||||
| 		sigaction(SIGWINCH, &sa, NULL); | ||||
|  | ||||
| 		/* Unmask signals */ | ||||
| 		sigprocmask(SIG_SETMASK, &old, NULL); | ||||
|  | ||||
| 		/* Safe to run now */ | ||||
| 		execl(file, file, cmd, (char *) NULL); | ||||
| 		syslog(LOG_ERR, "unable to exec `%s': %s\n", | ||||
| 		    file, strerror(errno)); | ||||
| 		_exit(EXIT_FAILURE); | ||||
| 	} | ||||
|  | ||||
| 	if (pid == -1) | ||||
| 		syslog(LOG_ERR, "fork: %s\n",strerror (errno)); | ||||
|  | ||||
| 	sigprocmask(SIG_SETMASK, &old, NULL); | ||||
| 	free(file); | ||||
| 	return pid; | ||||
| } | ||||
|  | ||||
| static void child_process(char *exec, char **argv) | ||||
| { | ||||
| 	RC_STRINGLIST *env_list; | ||||
| @@ -502,37 +437,53 @@ static void child_process(char *exec, char **argv) | ||||
| static void supervisor(char *exec, char **argv) | ||||
| { | ||||
| 	FILE *fp; | ||||
| 	char buf[2048]; | ||||
| 	char cmd[2048]; | ||||
| 	int count; | ||||
| 	int failing; | ||||
| 	int health_status; | ||||
| 	int healthcheck_respawn; | ||||
| 	pid_t wait_pid; | ||||
| 	int i; | ||||
| 	int nkilled; | ||||
| 	int sig_send; | ||||
| 	pid_t health_pid; | ||||
| 	pid_t wait_pid; | ||||
| 	sigset_t old_signals; | ||||
| 	sigset_t signals; | ||||
| 	struct sigaction sa; | ||||
| 	struct timespec ts; | ||||
| 	time_t respawn_now= 0; | ||||
| 	time_t first_spawn= 0; | ||||
| 	pid_t health_pid; | ||||
| 	int health_status; | ||||
|  | ||||
| 	/* block all signals we do not handle */ | ||||
| 	sigfillset(&signals); | ||||
| 	sigdelset(&signals, SIGALRM); | ||||
| 	sigdelset(&signals, SIGCHLD); | ||||
| 	sigdelset(&signals, SIGTERM); | ||||
| 	sigprocmask(SIG_SETMASK, &signals, &old_signals); | ||||
|  | ||||
| 	/* install signal  handler */ | ||||
| 	memset(&sa, 0, sizeof(sa)); | ||||
| 	sa.sa_handler = handle_signal; | ||||
| 	sigaction(SIGALRM, &sa, NULL); | ||||
| 	sigaction(SIGCHLD, &sa, NULL); | ||||
| 	sigaction(SIGTERM, &sa, NULL); | ||||
| #ifndef RC_DEBUG | ||||
| 	signal_setup_restart(SIGHUP, handle_signal); | ||||
| 	signal_setup_restart(SIGINT, handle_signal); | ||||
| 	signal_setup_restart(SIGQUIT, handle_signal); | ||||
| 	signal_setup_restart(SIGILL, handle_signal); | ||||
| 	signal_setup_restart(SIGABRT, handle_signal); | ||||
| 	signal_setup_restart(SIGFPE, handle_signal); | ||||
| 	signal_setup_restart(SIGSEGV, handle_signal); | ||||
| 	signal_setup_restart(SIGPIPE, handle_signal); | ||||
| 	signal_setup_restart(SIGALRM, handle_signal); | ||||
| 	signal_setup(SIGTERM, handle_signal); | ||||
| 	signal_setup_restart(SIGUSR1, handle_signal); | ||||
| 	signal_setup_restart(SIGUSR2, handle_signal); | ||||
| 	signal_setup_restart(SIGBUS, handle_signal); | ||||
| #ifdef SIGPOLL | ||||
| 	signal_setup_restart(SIGPOLL, handle_signal); | ||||
| #endif | ||||
| 	signal_setup_restart(SIGPROF, handle_signal); | ||||
| 	signal_setup_restart(SIGSYS, handle_signal); | ||||
| 	signal_setup_restart(SIGTRAP, handle_signal); | ||||
| 	signal_setup_restart(SIGVTALRM, handle_signal); | ||||
| 	signal_setup_restart(SIGXCPU, handle_signal); | ||||
| 	signal_setup_restart(SIGXFSZ, handle_signal); | ||||
| #ifdef SIGEMT | ||||
| 	signal_setup_restart(SIGEMT, handle_signal); | ||||
| #endif | ||||
| 	signal_setup_restart(SIGIO, handle_signal); | ||||
| #ifdef SIGPWR | ||||
| 	signal_setup_restart(SIGPWR, handle_signal); | ||||
| #endif | ||||
| #ifdef SIGUNUSED | ||||
| 	signal_setup_restart(SIGUNUSED, handle_signal); | ||||
| #endif | ||||
| #ifdef SIGRTMIN | ||||
| 	for (i = SIGRTMIN; i <= SIGRTMAX; i++) | ||||
| 		signal_setup_restart(i, handle_signal); | ||||
| #endif | ||||
| #endif | ||||
|  | ||||
| 	fp = fopen(pidfile, "w"); | ||||
| 	if (! fp) | ||||
| @@ -553,131 +504,100 @@ static void supervisor(char *exec, char **argv) | ||||
| 	/* | ||||
| 	 * Supervisor main loop | ||||
| 	 */ | ||||
| 	if (healthcheckdelay) | ||||
| 	i = 0; | ||||
| 	if (healthcheckdelay) { | ||||
| 		signal_setup(SIGALRM, healthcheck); | ||||
| 		alarm(healthcheckdelay); | ||||
| 	else if (healthchecktimer) | ||||
| 	} else if (healthchecktimer) { | ||||
| 		signal_setup(SIGALRM, healthcheck); | ||||
| 		alarm(healthchecktimer); | ||||
|  failing = 0; | ||||
| 	} | ||||
| 	while (!exiting) { | ||||
| 		healthcheck_respawn = 0; | ||||
|  	fifo_fd = open(fifopath, O_RDONLY); | ||||
| 		if (fifo_fd > 0) { | ||||
| 			memset(buf, 0, sizeof(buf)); | ||||
| 			count = read(fifo_fd, buf, sizeof(buf) - 1); | ||||
| 			close(fifo_fd); | ||||
| 			if (count != -1) | ||||
| 				buf[count] = 0; | ||||
| 			if (count == 0) | ||||
| 				continue; | ||||
| 			syslog(LOG_DEBUG, "Received %s from fifo", buf); | ||||
| 			if (strncasecmp(buf, "sig", 3) == 0) { | ||||
| 				if ((sscanf(buf, "%s %d", cmd, &sig_send) == 2) | ||||
| 						&& (sig_send >= 0 && sig_send < NSIG)) { | ||||
| 					syslog(LOG_INFO, "Sending signal %d to %d", sig_send, | ||||
| 							child_pid); | ||||
| 					if (kill(child_pid, sig_send) == -1) | ||||
| 						syslog(LOG_ERR, "Unable to send signal %d to %d", | ||||
| 								sig_send, child_pid); | ||||
| 		wait_pid = wait(&i); | ||||
| 		if (wait_pid == -1) { | ||||
| 			if (do_healthcheck) { | ||||
| 				do_healthcheck = 0; | ||||
| 				alarm(0); | ||||
| 				syslog(LOG_DEBUG, "running health check for %s", svcname); | ||||
| 				health_pid = exec_service(svcname, "healthcheck"); | ||||
| 				health_status = rc_waitpid(health_pid); | ||||
| 				if (WIFEXITED(health_status) && !WEXITSTATUS(health_status)) { | ||||
| 					alarm(healthchecktimer); | ||||
| 					continue; | ||||
| 				} else { | ||||
| 					syslog(LOG_WARNING, "health check for %s failed", svcname); | ||||
| 					health_pid = exec_service(svcname, "unhealthy"); | ||||
| 					rc_waitpid(health_pid); | ||||
| 					syslog(LOG_INFO, "stopping %s, pid %d", exec, child_pid); | ||||
| 					nkilled = run_stop_schedule(applet, NULL, NULL, child_pid, 0, | ||||
| 							false, false, true); | ||||
| 					if (nkilled > 0) | ||||
| 						syslog(LOG_INFO, "killed %d processes", nkilled); | ||||
| 					else if (errno != 0) | ||||
| 						syslog(LOG_INFO, "Unable to kill %d: %s", | ||||
| 								child_pid, strerror(errno)); | ||||
| 				} | ||||
| 			} | ||||
| 			continue; | ||||
| 		} | ||||
| 		if (do_healthcheck) { | ||||
| 			do_healthcheck = 0; | ||||
| 			alarm(0); | ||||
| 			syslog(LOG_DEBUG, "running health check for %s", svcname); | ||||
| 			health_pid = exec_command("healthcheck"); | ||||
| 			health_status = rc_waitpid(health_pid); | ||||
| 			if (WIFEXITED(health_status) && WEXITSTATUS(health_status) == 0) | ||||
| 				alarm(healthchecktimer); | ||||
| 			else { | ||||
| 				syslog(LOG_WARNING, "health check for %s failed", svcname); | ||||
| 				health_pid = exec_command("unhealthy"); | ||||
| 				rc_waitpid(health_pid); | ||||
| 			} else if (exiting ) { | ||||
| 				alarm(0); | ||||
| 				syslog(LOG_INFO, "stopping %s, pid %d", exec, child_pid); | ||||
| 				nkilled = run_stop_schedule(applet, NULL, NULL, child_pid, 0, | ||||
| 				nkilled = run_stop_schedule(applet, exec, NULL, child_pid, 0, | ||||
| 						false, false, true); | ||||
| 				if (nkilled < 0) | ||||
| 					syslog(LOG_INFO, "Unable to kill %d: %s", | ||||
| 							child_pid, strerror(errno)); | ||||
| 				else | ||||
| 					healthcheck_respawn = 1; | ||||
| 				if (nkilled > 0) | ||||
| 					syslog(LOG_INFO, "killed %d processes", nkilled); | ||||
| 				continue; | ||||
| 			} | ||||
| 		} | ||||
| 		if (exiting ) { | ||||
| 			alarm(0); | ||||
| 			syslog(LOG_INFO, "stopping %s, pid %d", exec, child_pid); | ||||
| 			nkilled = run_stop_schedule(applet, NULL, NULL, child_pid, 0, | ||||
| 					false, false, true); | ||||
| 			if (nkilled > 0) | ||||
| 				syslog(LOG_INFO, "killed %d processes", nkilled); | ||||
| 			continue; | ||||
| 		} | ||||
| 		wait_pid = waitpid(child_pid, &i, WNOHANG); | ||||
| 		if (wait_pid == child_pid) { | ||||
| 		} else if (wait_pid == child_pid) { | ||||
| 			if (WIFEXITED(i)) | ||||
| 				syslog(LOG_WARNING, "%s, pid %d, exited with return code %d", | ||||
| 						exec, child_pid, WEXITSTATUS(i)); | ||||
| 			else if (WIFSIGNALED(i)) | ||||
| 				syslog(LOG_WARNING, "%s, pid %d, terminated by signal %d", | ||||
| 						exec, child_pid, WTERMSIG(i)); | ||||
| 		} | ||||
| 		if (wait_pid == child_pid || healthcheck_respawn) { | ||||
| 			do_healthcheck = 0; | ||||
| 			healthcheck_respawn = 0; | ||||
| 			alarm(0); | ||||
| 		} else | ||||
| 			continue; | ||||
|  | ||||
| 		ts.tv_sec = respawn_delay; | ||||
| 		ts.tv_nsec = 0; | ||||
| 		nanosleep(&ts, NULL); | ||||
| 		if (respawn_max > 0 && respawn_period > 0) { | ||||
| 			respawn_now = time(NULL); | ||||
| 			if (first_spawn == 0) | ||||
| 				first_spawn = respawn_now; | ||||
| 			if ((respawn_period > 0) | ||||
| 					&& (respawn_now - first_spawn > respawn_period)) { | ||||
| 			if (respawn_now - first_spawn > respawn_period) { | ||||
| 				respawn_count = 0; | ||||
| 				first_spawn = 0; | ||||
| 			} else | ||||
| 				respawn_count++; | ||||
| 			if (respawn_max > 0 && respawn_count > respawn_max) { | ||||
| 				syslog(LOG_WARNING, "respawned \"%s\" too many times, exiting", | ||||
| 						exec); | ||||
| 				exiting = 1; | ||||
| 				failing = 1; | ||||
| 			if (respawn_count > respawn_max) { | ||||
| 				syslog(LOG_WARNING, | ||||
| 						"respawned \"%s\" too many times, exiting", exec); | ||||
| 				exiting = true; | ||||
| 				continue; | ||||
| 			} | ||||
| 			ts.tv_sec = respawn_delay; | ||||
| 			ts.tv_nsec = 0; | ||||
| 			nanosleep(&ts, NULL); | ||||
| 			child_pid = fork(); | ||||
| 			if (child_pid == -1) { | ||||
| 				syslog(LOG_ERR, "%s: fork: %s", applet, strerror(errno)); | ||||
| 				exit(EXIT_FAILURE); | ||||
| 			} | ||||
| 			if (child_pid == 0) { | ||||
| 				sigprocmask(SIG_SETMASK, &old_signals, NULL); | ||||
| 				memset(&sa, 0, sizeof(sa)); | ||||
| 				sa.sa_handler = SIG_DFL; | ||||
| 				sigaction(SIGALRM, &sa, NULL); | ||||
| 				sigaction(SIGCHLD, &sa, NULL); | ||||
| 				sigaction(SIGTERM, &sa, NULL); | ||||
| 				child_process(exec, argv); | ||||
| 			} | ||||
| 			if (healthcheckdelay) | ||||
| 				alarm(healthcheckdelay); | ||||
| 			else if (healthchecktimer) | ||||
| 				alarm(healthchecktimer); | ||||
| 		} | ||||
| 		alarm(0); | ||||
| 		child_pid = fork(); | ||||
| 		if (child_pid == -1) | ||||
| 			eerrorx("%s: fork: %s", applet, strerror(errno)); | ||||
| 		if (child_pid == 0) | ||||
| 			child_process(exec, argv); | ||||
| 		if (healthcheckdelay) { | ||||
| 			signal_setup(SIGALRM, healthcheck); | ||||
| 			alarm(healthcheckdelay); | ||||
| 		} else if (healthchecktimer) { | ||||
| 			signal_setup(SIGALRM, healthcheck); | ||||
| 			alarm(healthchecktimer); | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	if (pidfile && exists(pidfile)) | ||||
| 		unlink(pidfile); | ||||
| 	if (svcname) { | ||||
| 		rc_service_daemon_set(svcname, exec, (const char *const *)argv, | ||||
| 				pidfile, false); | ||||
| 		rc_service_value_set(svcname, "child_pid", NULL); | ||||
| 		rc_service_mark(svcname, RC_SERVICE_STOPPED); | ||||
| 		if (failing) | ||||
| 			rc_service_mark(svcname, RC_SERVICE_FAILED); | ||||
| 		rc_service_value_set(svcname, "child_pid", NULL); | ||||
| 	} | ||||
| 	if (pidfile && exists(pidfile)) | ||||
| 		unlink(pidfile); | ||||
| 	if (fifopath && exists(fifopath)) | ||||
| 		unlink(fifopath); | ||||
| 	exit(EXIT_SUCCESS); | ||||
| } | ||||
|  | ||||
| @@ -689,7 +609,6 @@ int main(int argc, char **argv) | ||||
| 	bool start = false; | ||||
| 	bool stop = false; | ||||
| 	bool reexec = false; | ||||
| 	bool sendsig = false; | ||||
| 	char *exec = NULL; | ||||
| 	char *retry = NULL; | ||||
| 	int sig = SIGTERM; | ||||
| @@ -795,10 +714,6 @@ int main(int argc, char **argv) | ||||
| 				eerrorx("Invalid respawn-period value '%s'", optarg); | ||||
| 			break; | ||||
|  | ||||
| 		case 's':  /* --signal */ | ||||
| 			sig = parse_signal(applet, optarg); | ||||
| 			sendsig = true; | ||||
| 			break; | ||||
| 		case 'S':  /* --start */ | ||||
| 			start = true; | ||||
| 			break; | ||||
| @@ -904,6 +819,8 @@ int main(int argc, char **argv) | ||||
| 		case_RC_COMMON_GETOPT | ||||
| 		} | ||||
|  | ||||
| 	if (!pidfile && !reexec) | ||||
| 		eerrorx("%s: --pidfile must be specified", applet); | ||||
| 	endpwent(); | ||||
| 	argc -= optind; | ||||
| 	argv += optind; | ||||
| @@ -916,12 +833,6 @@ int main(int argc, char **argv) | ||||
| 		ch_root = expand_home(home, ch_root); | ||||
|  | ||||
| 	umask(numask); | ||||
| 	if (!pidfile) | ||||
| 		xasprintf(&pidfile, "/var/run/supervise-%s.pid", svcname); | ||||
| 	xasprintf(&fifopath, "%s/supervise-%s.ctl", RC_SVCDIR, svcname); | ||||
| 	if (mkfifo(fifopath, 0600) == -1 && errno != EEXIST) | ||||
| 		eerrorx("%s: unable to create control fifo: %s", | ||||
| 				applet, strerror(errno)); | ||||
|  | ||||
| 	if (reexec) { | ||||
| 		str = rc_service_value_get(svcname, "argc"); | ||||
| @@ -996,7 +907,7 @@ int main(int argc, char **argv) | ||||
| 						0, false, true) > 0) | ||||
| 				eerrorx("%s: %s is already running", applet, exec); | ||||
|  | ||||
| 		if (respawn_period > 0 && respawn_delay * respawn_max > respawn_period) | ||||
| 		if (respawn_delay * respawn_max > respawn_period) | ||||
| 			ewarn("%s: Please increase the value of --respawn-period to more " | ||||
| 				"than %d to avoid infinite respawning", applet, | ||||
| 				respawn_delay * respawn_max); | ||||
| @@ -1043,9 +954,6 @@ int main(int argc, char **argv) | ||||
| 		tty_fd = open("/dev/tty", O_RDWR); | ||||
| #endif | ||||
| 		devnull_fd = open("/dev/null", O_RDWR); | ||||
| 		dup2(devnull_fd, STDIN_FILENO); | ||||
| 		dup2(devnull_fd, STDOUT_FILENO); | ||||
| 		dup2(devnull_fd, STDERR_FILENO); | ||||
| 		child_pid = fork(); | ||||
| 		if (child_pid == -1) | ||||
| 			eerrorx("%s: fork: %s", applet, strerror(errno)); | ||||
| @@ -1098,18 +1006,5 @@ int main(int argc, char **argv) | ||||
| 			rc_service_mark(svcname, RC_SERVICE_STOPPED); | ||||
| 		} | ||||
| 		exit(EXIT_SUCCESS); | ||||
| 	} else if (sendsig) { | ||||
| 		fifo_fd = open(fifopath, O_WRONLY |O_NONBLOCK); | ||||
| 		if (fifo_fd < 0) | ||||
| 			eerrorx("%s: unable to open control fifo %s", applet, strerror(errno)); | ||||
| 		xasprintf(&str, "sig %d", sig); | ||||
| 		x = write(fifo_fd, str, strlen(str)); | ||||
| 		if (x == -1) { | ||||
| 			free(tmp); | ||||
| 			eerrorx("%s: error writing to control fifo: %s", applet, | ||||
| 					strerror(errno)); | ||||
| 		} | ||||
| 		free(tmp); | ||||
| 		exit(EXIT_SUCCESS); | ||||
| 	} | ||||
| } | ||||
|   | ||||
| @@ -20,13 +20,6 @@ checkit() { | ||||
|  | ||||
| ret=0 | ||||
|  | ||||
| fail_on_out() { | ||||
| 	if [ -n "${out}" ]; then | ||||
| 		eerror "Last command failed; failing" | ||||
| 		exit 1 | ||||
| 	fi | ||||
| } | ||||
|  | ||||
| ebegin "Checking exported symbols in libeinfo.so (data)" | ||||
| checkit einfo.data $( | ||||
| readelf -Ws ${libeinfo_builddir}/libeinfo.so \ | ||||
| @@ -81,7 +74,6 @@ out=$(cd ${top_srcdir}; find */ \ | ||||
| 	-exec grep -n -E '[[:space:]]+$' {} +) | ||||
| [ -z "${out}" ] | ||||
| eend $? "Trailing whitespace needs to be deleted:"$'\n'"${out}" | ||||
| fail_on_out | ||||
|  | ||||
| ebegin "Checking trailing newlines in code" | ||||
| out=$(cd ${top_srcdir}; | ||||
| @@ -90,7 +82,6 @@ out=$(cd ${top_srcdir}; | ||||
| 	done) | ||||
| [ -z "${out}" ] | ||||
| eend $? "Trailing newlines need to be deleted:"$'\n'"${out}" | ||||
| fail_on_out | ||||
|  | ||||
| ebegin "Checking for obsolete functions" | ||||
| out=$(cd ${top_srcdir}; find src -name '*.[ch]' \ | ||||
| @@ -98,7 +89,6 @@ out=$(cd ${top_srcdir}; find src -name '*.[ch]' \ | ||||
| 	-exec grep -n -E '\<(malloc|memory|sys/(errno|fcntl|signal|stropts|termios|unistd))\.h\>' {} +) | ||||
| [ -z "${out}" ] | ||||
| eend $? "Avoid these obsolete functions:"$'\n'"${out}" | ||||
| fail_on_out | ||||
|  | ||||
| ebegin "Checking for x* func usage" | ||||
| out=$(cd ${top_srcdir}; find src -name '*.[ch]' \ | ||||
| @@ -109,7 +99,6 @@ out=$(cd ${top_srcdir}; find src -name '*.[ch]' \ | ||||
| 		-e src/libeinfo/libeinfo.c) | ||||
| [ -z "${out}" ] | ||||
| eend $? "These need to be using the x* variant:"$'\n'"${out}" | ||||
| fail_on_out | ||||
|  | ||||
| ebegin "Checking spacing style" | ||||
| out=$(cd ${top_srcdir}; find src -name '*.[ch]' \ | ||||
| @@ -124,7 +113,6 @@ out=$(cd ${top_srcdir}; find src -name '*.[ch]' \ | ||||
| 	{} +) | ||||
| [ -z "${out}" ] | ||||
| eend $? "These lines violate style rules:"$'\n'"${out}" | ||||
| fail_on_out | ||||
|  | ||||
| einfo "Running unit tests" | ||||
| eindent | ||||
|   | ||||
| @@ -57,6 +57,15 @@ Several other variables affect the way services behave under | ||||
| supervise-daemon. They are documented on the  openrc-run man page, but I | ||||
| will list them here for convenience: | ||||
|  | ||||
| ``` sh | ||||
| pidfile=/pid/of/supervisor.pid | ||||
| ``` | ||||
|  | ||||
| If you are using start-stop-daemon to monitor your scripts, the pidfile | ||||
| is the path to the pidfile the daemon creates. If, on the other hand, | ||||
| you are using supervise-daemon, this is the path to the pidfile the | ||||
| supervisor creates. | ||||
|  | ||||
| ``` sh | ||||
| command_args_foreground="arguments" | ||||
| ``` | ||||
|   | ||||
| @@ -1,23 +0,0 @@ | ||||
| #!/bin/bash | ||||
| # Copyright (c) 2007-2018 The OpenRC Authors. | ||||
| # See the Authors file at the top-level directory of this distribution and | ||||
| # https://github.com/OpenRC/openrc/blob/master/AUTHORS | ||||
| # | ||||
| # This file is part of OpenRC. It is subject to the license terms in | ||||
| # the LICENSE file found in the top-level directory of this | ||||
| # distribution and at https://github.com/OpenRC/openrc/blob/master/LICENSE | ||||
| # This file may not be copied, modified, propagated, or distributed | ||||
| # except according to the terms contained in the LICENSE file. | ||||
|  | ||||
| set -e | ||||
| set -u | ||||
| set -x | ||||
|  | ||||
| # These are steps to run on TravisCI under a containerized Ubuntu system. | ||||
| # See $TOP/.travis.yml for more info about the TravisCI setup. | ||||
|  | ||||
| cpus=$(getconf _NPROCESSORS_CONF || echo 1) | ||||
| # make on TravisCI doesn't support -O yet | ||||
| make -j"${cpus}" | ||||
|  | ||||
| make test | ||||
		Reference in New Issue
	
	Block a user