Compare commits
	
		
			52 Commits
		
	
	
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						 | 
					882c6bf3bc | ||
| 
						 | 
					91e14acf98 | ||
| 
						 | 
					238042d28b | ||
| 
						 | 
					8d6370d469 | ||
| 
						 | 
					75ce3addd2 | ||
| 
						 | 
					d818be6e2b | ||
| 
						 | 
					b812524303 | ||
| 
						 | 
					56c006ebd6 | ||
| 
						 | 
					067088bbff | ||
| 
						 | 
					52d4e56674 | ||
| 
						 | 
					6e6902c28b | ||
| 
						 | 
					084823182a | ||
| 
						 | 
					7478c104fc | ||
| 
						 | 
					065b7ecc0d | ||
| 
						 | 
					b054aca50b | ||
| 
						 | 
					f9e7a00ba9 | ||
| 
						 | 
					f1f48011ac | ||
| 
						 | 
					427a1ce299 | ||
| 
						 | 
					f43cec34ca | ||
| 
						 | 
					d64c9d2050 | ||
| 
						 | 
					b2b2c57a38 | ||
| 
						 | 
					155b845194 | ||
| 
						 | 
					9b578808fb | ||
| 
						 | 
					03164dd38d | ||
| 
						 | 
					2b82766452 | ||
| 
						 | 
					3eef6e9127 | ||
| 
						 | 
					77f09900a2 | ||
| 
						 | 
					50d77a4e5d | ||
| 
						 | 
					2d31b0a3f8 | ||
| 
						 | 
					b84d0bac4d | ||
| 
						 | 
					1ff3a37c60 | ||
| 
						 | 
					7e95d924c9 | ||
| a15b532a02 | |||
| 
						 | 
					3e00fbc9b0 | ||
| 
						 | 
					846e460075 | ||
| 
						 | 
					a32b14bbb4 | ||
| 
						 | 
					084877eb52 | ||
| 
						 | 
					97e74f9734 | ||
| 
						 | 
					d328de198d | ||
| 
						 | 
					a9fc26ac13 | ||
| 
						 | 
					40f7046696 | ||
| 
						 | 
					894995176e | ||
| 
						 | 
					5246ea7b6f | ||
| 
						 | 
					ed8b768c4a | ||
| 
						 | 
					825caa14de | ||
| 
						 | 
					d5c396cbfc | ||
| 
						 | 
					5427783fdf | ||
| 
						 | 
					d95425b08a | ||
| 
						 | 
					76420d9849 | ||
| 
						 | 
					bebc604438 | ||
| 
						 | 
					9dae4f2e38 | ||
| 
						 | 
					d126542dc6 | 
							
								
								
									
										15
									
								
								.cirrus.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								.cirrus.yml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,15 @@
 | 
				
			|||||||
 | 
					# Cirrus CI integration
 | 
				
			||||||
 | 
					# https://cirrus-ci.org
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					test_task:
 | 
				
			||||||
 | 
					  freebsd_instance:
 | 
				
			||||||
 | 
					    matrix:
 | 
				
			||||||
 | 
					      image: freebsd-12-0-release-amd64
 | 
				
			||||||
 | 
					      image: freebsd-11-2-release-amd64
 | 
				
			||||||
 | 
					  env:
 | 
				
			||||||
 | 
					    OS: FreeBSD
 | 
				
			||||||
 | 
					  procfs_script: >
 | 
				
			||||||
 | 
					    [ -f /proc/curproc ] || mount -t procfs proc /proc
 | 
				
			||||||
 | 
					  pkg_install_script: pkg install -y bash gawk gmake gsed
 | 
				
			||||||
 | 
					  gsed_hack_script: rm /usr/bin/sed && ln -s /usr/local/bin/gsed /usr/bin/sed
 | 
				
			||||||
 | 
					  test_script: bash ci/cirrus.sh
 | 
				
			||||||
							
								
								
									
										16
									
								
								.travis.yml
									
									
									
									
									
								
							
							
						
						
									
										16
									
								
								.travis.yml
									
									
									
									
									
								
							@@ -9,6 +9,20 @@ os:
 | 
				
			|||||||
compiler:
 | 
					compiler:
 | 
				
			||||||
  - gcc
 | 
					  - gcc
 | 
				
			||||||
  - clang
 | 
					  - clang
 | 
				
			||||||
 | 
					  - musl-gcc
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					addons:
 | 
				
			||||||
 | 
					  apt:
 | 
				
			||||||
 | 
					    packages:
 | 
				
			||||||
 | 
					    - musl-tools
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					notifications:
 | 
				
			||||||
 | 
					  irc:
 | 
				
			||||||
 | 
					    channels:
 | 
				
			||||||
 | 
					      - "irc.freenode.org#openrc"
 | 
				
			||||||
 | 
					    on_success: change  # options: [always|never|change] default: always
 | 
				
			||||||
 | 
					    on_failure: always  # options: [always|never|change] default: always
 | 
				
			||||||
 | 
					    on_start: false     # default: false
 | 
				
			||||||
 | 
					
 | 
				
			||||||
script:
 | 
					script:
 | 
				
			||||||
  - ./test/travis.sh
 | 
					  - ./ci/travis.sh
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										767
									
								
								ChangeLog
									
									
									
									
									
								
							
							
						
						
									
										767
									
								
								ChangeLog
									
									
									
									
									
								
							@@ -1,10 +1,430 @@
 | 
				
			|||||||
commit 63e40f31bfc7d8908fee8059ea383038832dd84f
 | 
					commit 238042d28b85277a4b5f19c3d13c4331b1325662
 | 
				
			||||||
 | 
					Author: William Hubbs <w.d.hubbs@gmail.com>
 | 
				
			||||||
 | 
					Commit: William Hubbs <w.d.hubbs@gmail.com>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    openrc-init: fix waitpid checks
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					    The do_openrc() function was not waiting properly for the child process
 | 
				
			||||||
 | 
					    which started the runlevel to return. We need to repeatedly call
 | 
				
			||||||
 | 
					    waitpid() until its return value matches the pid of the child process or
 | 
				
			||||||
 | 
					    the child process does not exist.
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					    This fixes #216.
 | 
				
			||||||
 | 
					    This fixes #300.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					commit 8d6370d4693f6f8397b808059e5fe436c8dc8993
 | 
				
			||||||
 | 
					Author: William Hubbs <w.d.hubbs@gmail.com>
 | 
				
			||||||
 | 
					Commit: William Hubbs <w.d.hubbs@gmail.com>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    version 0.41.1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					commit 75ce3addd2be964ce271858af08e7f750365916a
 | 
				
			||||||
 | 
					Author: William Hubbs <w.d.hubbs@gmail.com>
 | 
				
			||||||
 | 
					Commit: William Hubbs <w.d.hubbs@gmail.com>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    update ChangeLog
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					commit d818be6e2bc00c790f6f4aeb2670f007951b2ab3
 | 
				
			||||||
 | 
					Author: William Hubbs <w.d.hubbs@gmail.com>
 | 
				
			||||||
 | 
					Commit: William Hubbs <w.d.hubbs@gmail.com>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    librc: fix potential buffer overflow in pid_is_argv
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					    This fixes #299.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					commit b812524303ae42bf7f61a642c45e8be39aa222e5
 | 
				
			||||||
 | 
					Author: William Hubbs <w.d.hubbs@gmail.com>
 | 
				
			||||||
 | 
					Commit: William Hubbs <w.d.hubbs@gmail.com>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Revert "src/librc/librc-daemon.c: fix buffer overrun in pid_is_argv"
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					    This reverts commit 084877eb52971faf8f52c780ddd08ed9af140eb6.
 | 
				
			||||||
 | 
					    The mentioned commit caused some systems to have some services reported
 | 
				
			||||||
 | 
					    as crashed.
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					    This fixes #297.
 | 
				
			||||||
 | 
					    This fixes #298.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					commit 56c006ebd68d572e303c01c38291a1f5f4fc1c30
 | 
				
			||||||
 | 
					Author: William Hubbs <w.d.hubbs@gmail.com>
 | 
				
			||||||
 | 
					Commit: William Hubbs <w.d.hubbs@gmail.com>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Update ChangeLog
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					commit 067088bbff42ca2fb9106acf309f1d9ce3e78ada
 | 
				
			||||||
 | 
					Author: William Hubbs <w.d.hubbs@gmail.com>
 | 
				
			||||||
 | 
					Commit: William Hubbs <w.d.hubbs@gmail.com>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    move ci scripts to their own directory
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					    This fixes #296.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					commit 52d4e566743f57b9de81c77fdb605c171c02eacb
 | 
				
			||||||
 | 
					Author: William Hubbs <w.d.hubbs@gmail.com>
 | 
				
			||||||
 | 
					Commit: William Hubbs <w.d.hubbs@gmail.com>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    combine test directories
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					    This fixes #295.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					commit 6e6902c28b715826fdfc7b42a592db88459b9a57
 | 
				
			||||||
 | 
					Author: William Hubbs <w.d.hubbs@gmail.com>
 | 
				
			||||||
 | 
					Commit: William Hubbs <w.d.hubbs@gmail.com>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    remove unused test ignore patterns
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					commit 084823182aec4aef6fb880d642bba2d0ef91a3ad
 | 
				
			||||||
 | 
					Author: William Hubbs <w.d.hubbs@gmail.com>
 | 
				
			||||||
 | 
					Commit: William Hubbs <w.d.hubbs@gmail.com>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    remove unused test data files
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					commit 7478c104fc479067d71d191dccfa4cbf541311d8
 | 
				
			||||||
 | 
					Author: Georgy Yakovlev <gyakovlev@gentoo.org>
 | 
				
			||||||
 | 
					Commit: William Hubbs <w.d.hubbs@gmail.com>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    librc/librc-depend.c: fix NULL pointer dereference
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					    In some cases deptree or depinfo can be NULL, check
 | 
				
			||||||
 | 
					    before dereferencing.
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					    Fixes https://github.com/OpenRC/openrc/issues/293
 | 
				
			||||||
 | 
					    Fixes https://github.com/OpenRC/openrc/pulls/294
 | 
				
			||||||
 | 
					    X-Gentoo-Bug: 659906
 | 
				
			||||||
 | 
					    X-Gentoo-Bug-URL: https://bugs.gentoo.org/659906
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					commit 065b7ecc0d4ddd046cc235d60de20140db1a6fe8
 | 
				
			||||||
 | 
					Author: Georgy Yakovlev <gyakovlev@gentoo.org>
 | 
				
			||||||
 | 
					Commit: William Hubbs <w.d.hubbs@gmail.com>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    use cirrus-ci for FreeBSD builds
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					    This fixes #265.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					commit b054aca50b31fc46fc736a542ec2719de2d23d30
 | 
				
			||||||
 | 
					Author: Sergei Trofimovich <slyfox@gentoo.org>
 | 
				
			||||||
 | 
					Commit: William Hubbs <w.d.hubbs@gmail.com>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    src/test/runtests.sh: drop 'readelf'-based tests
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					    The 'readelf'-based tests cover a few situations:
 | 
				
			||||||
 | 
					    1. undefined symbols in shared libraries
 | 
				
			||||||
 | 
					    2. unexpected exports in shared libraries
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					    Bug #575958 shows that [2.] implementation is too simplistic
 | 
				
			||||||
 | 
					    in assuming that presence of relocation equals to export presence.
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					    It is incorrect for PLT stubs and local symbols.
 | 
				
			||||||
 | 
					    Let's just drop these tests.
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					    If one needs to cover [1.] it is better to use LDFLAGS=-Wl,--no-undefined.
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					    This closes #292.
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					    X-Reported-by: Benda Xu
 | 
				
			||||||
 | 
					    X-Gentoo-Bug: https://bugs.gentoo.org/575958
 | 
				
			||||||
 | 
					    X-Gentoo-Bug-URL: https://bugs.gentoo.org/575958
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					commit f9e7a00ba9c9b179c697fc0af83a19e923c831b0
 | 
				
			||||||
 | 
					Author: William Hubbs <w.d.hubbs@gmail.com>
 | 
				
			||||||
 | 
					Commit: William Hubbs <w.d.hubbs@gmail.com>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    rc-status: style fixes
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					commit f1f48011acb266db309922f145653b86f11e0baf
 | 
				
			||||||
 | 
					Author: William Hubbs <w.d.hubbs@gmail.com>
 | 
				
			||||||
 | 
					Commit: William Hubbs <w.d.hubbs@gmail.com>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    update ChangeLog
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					commit 427a1ce2995b376ed6d112c5c5b422217f815fbb
 | 
				
			||||||
 | 
					Author: William Hubbs <w.d.hubbs@gmail.com>
 | 
				
			||||||
 | 
					Commit: William Hubbs <w.d.hubbs@gmail.com>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    rc-status: add -f option to allow formatting output
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					    The -f option can be used when showing the status of services in
 | 
				
			||||||
 | 
					    runlevels to allow making the output more easily parsable.
 | 
				
			||||||
 | 
					    Currently, the .ini format is the only one supported.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					commit f43cec34ca0201031fc10b584bcb391859f302cd
 | 
				
			||||||
 | 
					Author: William Hubbs <w.d.hubbs@gmail.com>
 | 
				
			||||||
 | 
					Commit: William Hubbs <w.d.hubbs@gmail.com>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    rc-status.c: small style changes
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					commit d64c9d205083ca82823f9f5ff178a5581f6c8b2a
 | 
				
			||||||
 | 
					Author: William Hubbs <w.d.hubbs@gmail.com>
 | 
				
			||||||
 | 
					Commit: William Hubbs <w.d.hubbs@gmail.com>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    add experimental support for an alternate shell for service scripts
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					    This is for #288.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					commit b2b2c57a3898c945b33b8bf0a10b658483be09c1
 | 
				
			||||||
 | 
					Author: Edan Bedrik <3d4nb3@gmail.com>
 | 
				
			||||||
 | 
					Commit: William Hubbs <w.d.hubbs@gmail.com>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    librc: fix realpath() return value check
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					    This fixes #226.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					commit 155b8451945f8a17cd61ad56be3bb09541c3719a
 | 
				
			||||||
 | 
					Author: William Hubbs <w.d.hubbs@gmail.com>
 | 
				
			||||||
 | 
					Commit: William Hubbs <w.d.hubbs@gmail.com>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    improve shutdown documentation
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					    This fixes #290.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					commit 9b578808fb67682780adb17157330934a5c2cce7
 | 
				
			||||||
 | 
					Author: Austin English <austinenglish@gmail.com>
 | 
				
			||||||
 | 
					Commit: William Hubbs <w.d.hubbs@gmail.com>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    travis: try enabling musl-gcc
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					    This fixes #261.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					commit 03164dd38d9e8d9a93141e5d6b495f306875bcd9
 | 
				
			||||||
 | 
					Author: Austin English <austinenglish@gmail.com>
 | 
				
			||||||
 | 
					Commit: William Hubbs <w.d.hubbs@gmail.com>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    fix build with muslc
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					    This fixes #261.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					commit 2b82766452adec4eb99f61902d62f0fa2e369fa4
 | 
				
			||||||
 | 
					Author: Austin English <austinenglish@gmail.com>
 | 
				
			||||||
 | 
					Commit: William Hubbs <w.d.hubbs@gmail.com>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    test/skel.runtests.sh: remove unused file
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					    git grep shows no usage, and `make test` passes
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					    This fixes #256.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					commit 3eef6e91274f2e07bd566f206e89d9b0b9c45fb9
 | 
				
			||||||
 | 
					Author: Felix Neumärker <xdch47@posteo.de>
 | 
				
			||||||
 | 
					Commit: William Hubbs <w.d.hubbs@gmail.com>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    zsh-completion: _rc-service support extra actions
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					      - use rc-service <service> describe to get action list
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					    This is for #285.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					commit 77f09900a2e0eeb1475e9ee404b6e7ff76ff8e9d
 | 
				
			||||||
 | 
					Author: Felix Neumärker <xdch47@posteo.de>
 | 
				
			||||||
 | 
					Commit: William Hubbs <w.d.hubbs@gmail.com>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    zsh-completion: _rc-service fix flag/command combinations
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					      - handle `rc-service -<flag> <service> <action>` correctly
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					    This is for #285.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					commit 50d77a4e5d8c321cc89565295db13e60b2fb2cc7
 | 
				
			||||||
 | 
					Author: Kim Jahn <kim@maisspace.org>
 | 
				
			||||||
 | 
					Commit: William Hubbs <w.d.hubbs@gmail.com>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    man/openrc.8: add openrc-run.8  to see also
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					    This fixes #283.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					commit 2d31b0a3f8b4be7290e596cb7072b78361e1734b
 | 
				
			||||||
 | 
					Author: Mike Frysinger <vapier@gentoo.org>
 | 
				
			||||||
 | 
					Commit: Mike Frysinger <vapier@gentoo.org>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    man: supervise-daemon: fix various style issues
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					    The .Dt header is supposed to be all caps.  This was mixing case.
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					    The options block was being incorrectly indented due to a missing .El.
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					    Some of the new options were missing the .It block, so add that.
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					    Finally, the -D option was missing capitalization.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					commit b84d0bac4d3f23ff969827d74808fd7bd1c621c3
 | 
				
			||||||
 | 
					Author: William Hubbs <w.d.hubbs@gmail.com>
 | 
				
			||||||
 | 
					Commit: William Hubbs <w.d.hubbs@gmail.com>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    travis-ci: add IRC notifications
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					commit 1ff3a37c60e89da31c5c06bb4edd184770c91923
 | 
				
			||||||
 | 
					Author: William Hubbs <w.d.hubbs@gmail.com>
 | 
				
			||||||
 | 
					Commit: William Hubbs <w.d.hubbs@gmail.com>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    start-stop-daemon: fix compiler warning
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					commit 7e95d924c9067d9d643fc3b533f777ea7a5234d7
 | 
				
			||||||
 | 
					Author: William Hubbs <w.d.hubbs@gmail.com>
 | 
				
			||||||
 | 
					Commit: William Hubbs <w.d.hubbs@gmail.com>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    bash-completions/rc-service: allow tab to be used again
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					    X-Gentoo-Bug: 670290
 | 
				
			||||||
 | 
					    X-Gentoo-Bug-URL: https://bugs.gentoo.org/670290
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					commit a15b532a02094b3afe9d698f6b98e70f0fd4506a
 | 
				
			||||||
 | 
					Author: artoo <artoo@artixlinux.org>
 | 
				
			||||||
 | 
					Commit: William Hubbs <w.d.hubbs@gmail.com>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    scripts: fix halt, poweroff and reboot wrappers
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					    These are designed to emulate the sysvinit equivalents, so pass "now" as
 | 
				
			||||||
 | 
					    the time argument if no arguments are given.
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					    This fixes #268.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					commit 3e00fbc9b08dde9e2c7fc26ecb9e831417012dd1
 | 
				
			||||||
 | 
					Author: philhofer <phofer@umich.edu>
 | 
				
			||||||
 | 
					Commit: William Hubbs <w.d.hubbs@gmail.com>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    fix leading whitespace
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					    Clean up code indented with mixed tabs and spaces.
 | 
				
			||||||
 | 
					    No actual code changes.
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					    This fixes #280.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					commit 846e4600754dab3f0cb49edb4ad9e2b2b73d3f47
 | 
				
			||||||
 | 
					Author: philhofer <phofer@umich.edu>
 | 
				
			||||||
 | 
					Commit: William Hubbs <w.d.hubbs@gmail.com>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    fix potential out-of-bounds reads
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					    readlink(3) does not nul-terminate the result it sticks
 | 
				
			||||||
 | 
					    into the supplied buffer. Consequently, the code
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					      rc = readlink(path, buf, sizeof(buf));
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					    does not necessarily produce a C string.
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					    The code in rc_find_pid() produces some C strings this way
 | 
				
			||||||
 | 
					    and passes them to strlen() and strcmp(), which can lead
 | 
				
			||||||
 | 
					    to an out-of-bounds read.
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					    In this case, since the code already takes care to
 | 
				
			||||||
 | 
					    zero-initialize the buffers before passing them
 | 
				
			||||||
 | 
					    to readlink(3), only allow sizeof(buf)-1 bytes to
 | 
				
			||||||
 | 
					    be returned.
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					    (While fixing this issue, I fixed two other locations that
 | 
				
			||||||
 | 
					    used the same problematic pattern.)
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					    This fixes #270.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					commit a32b14bbb43e9888acaaea6f764fb8dcb34fb941
 | 
				
			||||||
 | 
					Author: William Hubbs <w.d.hubbs@gmail.com>
 | 
				
			||||||
 | 
					Commit: William Hubbs <w.d.hubbs@gmail.com>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Do not use UT_LINESIZE or __UT_LINESIZE
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					    These are not standard.
 | 
				
			||||||
 | 
					    For more information see issue #279.
 | 
				
			||||||
 | 
					    This fixes #279.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					commit 084877eb52971faf8f52c780ddd08ed9af140eb6
 | 
				
			||||||
 | 
					Author: philhofer <phofer@umich.edu>
 | 
				
			||||||
 | 
					Commit: William Hubbs <w.d.hubbs@gmail.com>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    src/librc/librc-daemon.c: fix buffer overrun in pid_is_argv
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					    The contents of /proc/<pid>/cmdline are read into
 | 
				
			||||||
 | 
					    a stack buffer using
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					      bytes = read(fd, buffer, sizeof(buffer));
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					    followed by appending a null terminator to the buffer with
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					      buffer[bytes] = '\0';
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					    If bytes == sizeof(buffer), then this write is out-of-bounds.
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					    Refactor the code to use rc_getfile instead, since PATH_MAX
 | 
				
			||||||
 | 
					    is not the maximum size of /proc/<pid>/cmdline. (I hit this
 | 
				
			||||||
 | 
					    issue in practice while compiling Linux; it tripped the
 | 
				
			||||||
 | 
					    stack-smashing protector.)
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					    This is roughly the same buffer overflow condition
 | 
				
			||||||
 | 
					    that was fixed by commit 0ddee9b7d2b8dea810e252ca6a95c457876df120
 | 
				
			||||||
 | 
					    This fixes #269.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					commit 97e74f97347f5798e01a47057efab00906754546
 | 
				
			||||||
 | 
					Author: philhofer <phofer@umich.edu>
 | 
				
			||||||
 | 
					Commit: William Hubbs <w.d.hubbs@gmail.com>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    src/rc/supervise-daemon.c: formatting fixes
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					    Fix misleading indentation and other erroneous whitespace.
 | 
				
			||||||
 | 
					    This fixes #273.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					commit d328de198d0ad980188b105decc09405652aa3d6
 | 
				
			||||||
 | 
					Author: William Hubbs <w.d.hubbs@gmail.com>
 | 
				
			||||||
 | 
					Commit: William Hubbs <w.d.hubbs@gmail.com>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    remove /run migration script again
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					    This time it was done correctly.
 | 
				
			||||||
 | 
					    I missed a '\' the last time.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					commit a9fc26ac1367ac887eab76007e8834dfe787edcd
 | 
				
			||||||
 | 
					Author: philhofer <phofer@umich.edu>
 | 
				
			||||||
 | 
					Commit: Mike Frysinger <vapier@gmail.com>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    src/rc/supervise-daemon.c: do not pass NULL to strcmp
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					    The following will cause a segfault due to NULL being
 | 
				
			||||||
 | 
					    passed to strcmp(3)
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					    $ RC_SVCNAME=foo supervise-daemon
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					    Fix the bounds check on argc in main. If argc<=1, then
 | 
				
			||||||
 | 
					    it is not safe to dereference argv[1].
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					commit 40f70466969b340ee5e277c98a4b27a9117b795e
 | 
				
			||||||
 | 
					Author: philhofer <phofer@umich.edu>
 | 
				
			||||||
 | 
					Commit: Mike Frysinger <vapier@gmail.com>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    src/rc/openrc-run.c: remove duplicate statement
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					    The statement
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					      ll = strlen(applet);
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					    appears twice in the same block without any
 | 
				
			||||||
 | 
					    intervening assignment to the variables
 | 
				
			||||||
 | 
					    'll' or 'applet'
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					    Remove the second (duplicate) statement.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					commit 894995176e827eef16bf90b6479b7c285677ceef
 | 
				
			||||||
 | 
					Author: William Hubbs <w.d.hubbs@gmail.com>
 | 
				
			||||||
 | 
					Commit: William Hubbs <w.d.hubbs@gmail.com>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Revert "remove /run migration script"
 | 
				
			||||||
 | 
					    For some reason removing this broke the build.
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					    This reverts commit 5246ea7b6f8c6a247403f725f8301457f6ddfffd.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					commit 5246ea7b6f8c6a247403f725f8301457f6ddfffd
 | 
				
			||||||
 | 
					Author: William Hubbs <w.d.hubbs@gmail.com>
 | 
				
			||||||
 | 
					Commit: William Hubbs <w.d.hubbs@gmail.com>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    remove /run migration script
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					    We have used /run for some time now and we have had this migration
 | 
				
			||||||
 | 
					    script for 6 years. Linux users should have upgraded by now to a version
 | 
				
			||||||
 | 
					    of OpenRC which stores its information in /run.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					commit ed8b768c4a68042eed0c21c8305640841b22f006
 | 
				
			||||||
Author: William Hubbs <w.d.hubbs@gmail.com>
 | 
					Author: William Hubbs <w.d.hubbs@gmail.com>
 | 
				
			||||||
Commit: William Hubbs <w.d.hubbs@gmail.com>
 | 
					Commit: William Hubbs <w.d.hubbs@gmail.com>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    fix compiler warnings
 | 
					    fix compiler warnings
 | 
				
			||||||
 | 
					
 | 
				
			||||||
commit e43ee29eb4310ff23c438d1877ef79c56539b002
 | 
					commit 825caa14de6160c966d44d64d5c0254f4038d9a0
 | 
				
			||||||
Author: William Hubbs <w.d.hubbs@gmail.com>
 | 
					Author: William Hubbs <w.d.hubbs@gmail.com>
 | 
				
			||||||
Commit: William Hubbs <w.d.hubbs@gmail.com>
 | 
					Commit: William Hubbs <w.d.hubbs@gmail.com>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -17,7 +437,7 @@ Commit: William Hubbs <w.d.hubbs@gmail.com>
 | 
				
			|||||||
    
 | 
					    
 | 
				
			||||||
    This is for #271.
 | 
					    This is for #271.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
commit a3555b144291b7d32f7c14fd9bd0dbe3ee6e33f9
 | 
					commit d5c396cbfc49ce88f58d944c8ab01d2c36ccdc7b
 | 
				
			||||||
Author: William Hubbs <w.d.hubbs@gmail.com>
 | 
					Author: William Hubbs <w.d.hubbs@gmail.com>
 | 
				
			||||||
Commit: William Hubbs <w.d.hubbs@gmail.com>
 | 
					Commit: William Hubbs <w.d.hubbs@gmail.com>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -26,19 +446,29 @@ Commit: William Hubbs <w.d.hubbs@gmail.com>
 | 
				
			|||||||
    This will make it easier to track down why the supervisor intermittently
 | 
					    This will make it easier to track down why the supervisor intermittently
 | 
				
			||||||
    hangs after it runs for a long time.
 | 
					    hangs after it runs for a long time.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
commit eb863156fbcbce236c60dec0e90338edbd9de686
 | 
					commit 5427783fdf3d183ea4e63afc507c31d88f0d2c9c
 | 
				
			||||||
Author: William Hubbs <w.d.hubbs@gmail.com>
 | 
					Author: William Hubbs <w.d.hubbs@gmail.com>
 | 
				
			||||||
Commit: William Hubbs <w.d.hubbs@gmail.com>
 | 
					Commit: William Hubbs <w.d.hubbs@gmail.com>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    version 0.40.3
 | 
					    standardize the default shell
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
commit ac76b24b85d3767a9561b76ac0fee5569383a63a
 | 
					    I do not know of a need to have the default shell be a build-time
 | 
				
			||||||
 | 
					    configurable setting. All *nix systems I am aware of have /bin/sh as a
 | 
				
			||||||
 | 
					    default posix compatible shell.
 | 
				
			||||||
 | 
					    If some systems running OpenRC do not make that assumption about
 | 
				
			||||||
 | 
					    /bin/sh, I will consider bringing this back, so feel free to open an
 | 
				
			||||||
 | 
					    issue.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					commit d95425b08a1675efb66def056d0f92e6b2d78a77
 | 
				
			||||||
Author: William Hubbs <w.d.hubbs@gmail.com>
 | 
					Author: William Hubbs <w.d.hubbs@gmail.com>
 | 
				
			||||||
Commit: William Hubbs <w.d.hubbs@gmail.com>
 | 
					Commit: William Hubbs <w.d.hubbs@gmail.com>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    Update ChangeLog
 | 
					    rc-cgroup.sh: remove shebang line
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
commit b8e57c693a973528799c9a5fdf86135b658dcce2
 | 
					    This is not a stand-alone script, so it does not need the shebang line.
 | 
				
			||||||
 | 
					    This also means it is not necessary to run this through sed.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					commit 76420d9849e6832a52aa4c1ba1fd2895b7d51a08
 | 
				
			||||||
Author: William Hubbs <w.d.hubbs@gmail.com>
 | 
					Author: William Hubbs <w.d.hubbs@gmail.com>
 | 
				
			||||||
Commit: William Hubbs <w.d.hubbs@gmail.com>
 | 
					Commit: William Hubbs <w.d.hubbs@gmail.com>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -52,7 +482,7 @@ Commit: William Hubbs <w.d.hubbs@gmail.com>
 | 
				
			|||||||
    If an agetty is respawning faster than 10 times in 60 seconds, this
 | 
					    If an agetty is respawning faster than 10 times in 60 seconds, this
 | 
				
			||||||
    seems to be too fast.
 | 
					    seems to be too fast.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
commit 5df12e24146cd091de71c77737c07eed5a14101f
 | 
					commit bebc604438f9586f26d0cad8bd72749ae84b4335
 | 
				
			||||||
Author: William Hubbs <w.d.hubbs@gmail.com>
 | 
					Author: William Hubbs <w.d.hubbs@gmail.com>
 | 
				
			||||||
Commit: William Hubbs <w.d.hubbs@gmail.com>
 | 
					Commit: William Hubbs <w.d.hubbs@gmail.com>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -60,19 +490,7 @@ Commit: William Hubbs <w.d.hubbs@gmail.com>
 | 
				
			|||||||
    
 | 
					    
 | 
				
			||||||
    This fixes #264.
 | 
					    This fixes #264.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
commit 461df0c78b1b8a58bb272958dce4af39fc2549c0
 | 
					commit 9dae4f2e38ceae227933673e25db9583e8f610a6
 | 
				
			||||||
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>
 | 
					Author: Alexander Zubkov <green@msu.ru>
 | 
				
			||||||
Commit: William Hubbs <w.d.hubbs@gmail.com>
 | 
					Commit: William Hubbs <w.d.hubbs@gmail.com>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -80,11 +498,11 @@ Commit: William Hubbs <w.d.hubbs@gmail.com>
 | 
				
			|||||||
    
 | 
					    
 | 
				
			||||||
    This fixes #239.
 | 
					    This fixes #239.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
commit 4aa5686d9037132b27d7554436738fa98e8e9057
 | 
					commit d126542dc626c8295b0f2cfcdee7bf5aa79daff1
 | 
				
			||||||
Author: William Hubbs <w.d.hubbs@gmail.com>
 | 
					Author: William Hubbs <w.d.hubbs@gmail.com>
 | 
				
			||||||
Commit: William Hubbs <w.d.hubbs@gmail.com>
 | 
					Commit: William Hubbs <w.d.hubbs@gmail.com>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    version 0.40.1
 | 
					    version 0.41
 | 
				
			||||||
 | 
					
 | 
				
			||||||
commit ab6c8d56f155564f56d61553c4b1af9e7f63a9d2
 | 
					commit ab6c8d56f155564f56d61553c4b1af9e7f63a9d2
 | 
				
			||||||
Author: William Hubbs <w.d.hubbs@gmail.com>
 | 
					Author: William Hubbs <w.d.hubbs@gmail.com>
 | 
				
			||||||
@@ -1063,304 +1481,3 @@ Author: William Hubbs <w.d.hubbs@gmail.com>
 | 
				
			|||||||
Commit: William Hubbs <w.d.hubbs@gmail.com>
 | 
					Commit: William Hubbs <w.d.hubbs@gmail.com>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    openrc-init: convert execl calls to execlp
 | 
					    openrc-init: convert execl calls to execlp
 | 
				
			||||||
 | 
					 | 
				
			||||||
commit f383fd87b121492a04362ca9041f686d981718f1
 | 
					 | 
				
			||||||
Author: William Hubbs <w.d.hubbs@gmail.com>
 | 
					 | 
				
			||||||
Commit: William Hubbs <w.d.hubbs@gmail.com>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    kill_all: change execl call to execlp
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
commit cfded513cd9b7febe4b7cf39a80411e4303f0655
 | 
					 | 
				
			||||||
Author: William Hubbs <w.d.hubbs@gmail.com>
 | 
					 | 
				
			||||||
Commit: William Hubbs <w.d.hubbs@gmail.com>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    openrc-init: set a default path
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
    The default path provided by the system if one isn't set only includes
 | 
					 | 
				
			||||||
    "/bin:/usr/bin". This adds the default path setting from sysvinit.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
commit 16ff3cd8df6169f73e3d7cf00758a4703f62cbf0
 | 
					 | 
				
			||||||
Author: Christian Brauner <christian.brauner@ubuntu.com>
 | 
					 | 
				
			||||||
Commit: William Hubbs <w.d.hubbs@gmail.com>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    check whether /sys/fs/cgroup is a mountpoint
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
    The current check only tries to detect whether /sys/fs/cgroup exists and
 | 
					 | 
				
			||||||
    whether it is writable or not. But when the init system doesn't mount
 | 
					 | 
				
			||||||
    cgroups then /sys/fs/cgroup will just be an empty directory. When paired
 | 
					 | 
				
			||||||
    with unprivileged containers that mount sysfs this will cause misleading
 | 
					 | 
				
			||||||
    errors to be printed since /sys/fs/cgroup will be owned by user
 | 
					 | 
				
			||||||
    nobody:nogroup in this case. Independent of this specific problem this
 | 
					 | 
				
			||||||
    check will also be misleading when the /sys/fs/cgroup exists and is in
 | 
					 | 
				
			||||||
    fact writable by the init system but isn't actually a mountpoint.
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
    Note from William. "grep -qs" doesn't need to redirect output to
 | 
					 | 
				
			||||||
    /dev/null since it is completely silent.
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
    This fixes #209.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
commit 38032626a6c2f8e869197999f32ac3634667cc86
 | 
					 | 
				
			||||||
Author: William Hubbs <w.d.hubbs@gmail.com>
 | 
					 | 
				
			||||||
Commit: William Hubbs <w.d.hubbs@gmail.com>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    improve cgroup configuration checks
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
    make the base/controller functions return successfully if cgroups v1/v2
 | 
					 | 
				
			||||||
    are not configured in the kernel
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
commit aa7d3a7911b658c550e7ce76cd6d7d46541fc323
 | 
					 | 
				
			||||||
Author: William Hubbs <w.d.hubbs@gmail.com>
 | 
					 | 
				
			||||||
Commit: William Hubbs <w.d.hubbs@gmail.com>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    openrc: force deptree update for sysinit runlevel
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
commit 98262647a9d2f3c65a7ceb1aaa81095522c1ef06
 | 
					 | 
				
			||||||
Author: William Hubbs <w.d.hubbs@gmail.com>
 | 
					 | 
				
			||||||
Commit: William Hubbs <w.d.hubbs@gmail.com>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    supervise-daemon: zero out the cmdline buffer when it is allocated
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
commit 5868abe97babcc287794dcb36ad8e77989b6ddcf
 | 
					 | 
				
			||||||
Author: William Hubbs <w.d.hubbs@gmail.com>
 | 
					 | 
				
			||||||
Commit: William Hubbs <w.d.hubbs@gmail.com>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    start-stop-daemon: compiler warning cleanup
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
commit 71aad16256604e0e9e146221957a9b00cfe67b99
 | 
					 | 
				
			||||||
Author: William Hubbs <w.d.hubbs@gmail.com>
 | 
					 | 
				
			||||||
Commit: William Hubbs <w.d.hubbs@gmail.com>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    openrc-run: clean up a compiler warning
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
commit e275da84de1589253da5ff6a7c272cf1c82f8567
 | 
					 | 
				
			||||||
Author: William Hubbs <w.d.hubbs@gmail.com>
 | 
					 | 
				
			||||||
Commit: William Hubbs <w.d.hubbs@gmail.com>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    supervise-daemon: remove references to PATH_MAX
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
commit a6cc7f06cf3807a0e0590697e1f14e6ab9055271
 | 
					 | 
				
			||||||
Author: William Hubbs <w.d.hubbs@gmail.com>
 | 
					 | 
				
			||||||
Commit: William Hubbs <w.d.hubbs@gmail.com>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    rc.c: remove PATH_MAX references
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
commit c1178c8eebb92c9f3702e981cd4af9ef41f51884
 | 
					 | 
				
			||||||
Author: William Hubbs <w.d.hubbs@gmail.com>
 | 
					 | 
				
			||||||
Commit: William Hubbs <w.d.hubbs@gmail.com>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    rc-selinux.c: remove references to path_max
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
commit 3c031ca9780c555817fe9ccb8b23ceb231129724
 | 
					 | 
				
			||||||
Author: William Hubbs <w.d.hubbs@gmail.com>
 | 
					 | 
				
			||||||
Commit: William Hubbs <w.d.hubbs@gmail.com>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    rc-plubin.c: remove references to PATH_MAX
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
commit 8e02406d8fbf92167c30431987d5de8de72cd7df
 | 
					 | 
				
			||||||
Author: William Hubbs <w.d.hubbs@gmail.com>
 | 
					 | 
				
			||||||
Commit: William Hubbs <w.d.hubbs@gmail.com>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    rc-misc.c: remove references to PATH_MAX
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
commit 8dbdabcc5e0df8ac36722a4ba7bfe30664cc9919
 | 
					 | 
				
			||||||
Author: William Hubbs <w.d.hubbs@gmail.com>
 | 
					 | 
				
			||||||
Commit: William Hubbs <w.d.hubbs@gmail.com>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    start-stop-daemon: clean up string handling
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
commit 488d8989c518d9256f183899aac02024c679b93e
 | 
					 | 
				
			||||||
Author: William Hubbs <w.d.hubbs@gmail.com>
 | 
					 | 
				
			||||||
Commit: William Hubbs <w.d.hubbs@gmail.com>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    openrc-run: clean up string handling
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
    - remove references to PATH_MAX
 | 
					 | 
				
			||||||
    - use xasprintf to create strings
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
commit 9e14b35da8942bd8fa552363617c3415887f485f
 | 
					 | 
				
			||||||
Author: William Hubbs <w.d.hubbs@gmail.com>
 | 
					 | 
				
			||||||
Commit: William Hubbs <w.d.hubbs@gmail.com>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    rc-update: remove reference to PATH_MAX
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
commit 7b4879cb72e907414b70553663bd9b6fda8d4408
 | 
					 | 
				
			||||||
Author: William Hubbs <w.d.hubbs@gmail.com>
 | 
					 | 
				
			||||||
Commit: William Hubbs <w.d.hubbs@gmail.com>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    mountinfo: create strings with xasprintf
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
commit 74cfb455c59298f86849541e724ae346ff205c3d
 | 
					 | 
				
			||||||
Author: William Hubbs <w.d.hubbs@gmail.com>
 | 
					 | 
				
			||||||
Commit: William Hubbs <w.d.hubbs@gmail.com>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    kill_all: create strings with xasprintf
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
commit 0110487722646ebf9bc2c4e12b4b4a3c358cb10d
 | 
					 | 
				
			||||||
Author: William Hubbs <w.d.hubbs@gmail.com>
 | 
					 | 
				
			||||||
Commit: William Hubbs <w.d.hubbs@gmail.com>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    helpers.h: silence compiler warnings about xasprintf
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
commit 68b9b0bc2a11d144870d14fcb8ac24e6c9c63354
 | 
					 | 
				
			||||||
Author: William Hubbs <w.d.hubbs@gmail.com>
 | 
					 | 
				
			||||||
Commit: William Hubbs <w.d.hubbs@gmail.com>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    xasprintf: exit if return value of vsnprintf is invalid
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
commit 4616f8f809ee8566904ca37f2b8bf0409a487475
 | 
					 | 
				
			||||||
Author: William Hubbs <w.d.hubbs@gmail.com>
 | 
					 | 
				
			||||||
Commit: William Hubbs <w.d.hubbs@gmail.com>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    helpers.h: add xasprintf function
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
    This is our own version of asprintf(). This original code was written by
 | 
					 | 
				
			||||||
    Mike Frysinger, and I was able to modify it to use our memory helper
 | 
					 | 
				
			||||||
    functions.
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
    We need a version of this code because it is not available on glibc at
 | 
					 | 
				
			||||||
    least without defining _GNU_SOURCE, and I would rather not do that.
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
    This is the first step in improving string handling in OpenRC for #207.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
commit 287d71bd2591ddec73efe356db081020e65cd922
 | 
					 | 
				
			||||||
Author: William Hubbs <w.d.hubbs@gmail.com>
 | 
					 | 
				
			||||||
Commit: William Hubbs <w.d.hubbs@gmail.com>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    helpers.h: style fix
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
commit c1ffe4d9f2e10b6853464cc298d1922c81ae92f4
 | 
					 | 
				
			||||||
Author: Michael Orlitzky <michael@orlitzky.com>
 | 
					 | 
				
			||||||
Commit: William Hubbs <w.d.hubbs@gmail.com>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    man/openrc-run.8: fix mountinfo args.
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
    The "Ar" tag for the mountinfo command contained a typo (leading
 | 
					 | 
				
			||||||
    space) that resulted in the tag being output verbatim; that is,
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
      mountinfo ... .Ar mount1 mount2
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
    rather than e.g.
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
      mountinfo ... <mount1> <mount2>
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
    This commit deletes the leading space to fix the output.
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
    This fixes #204.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
commit 4c517bdb2b69eac36f004ae41bb9cbb212fe0a51
 | 
					 | 
				
			||||||
Author: Michael Orlitzky <michael@orlitzky.com>
 | 
					 | 
				
			||||||
Commit: William Hubbs <w.d.hubbs@gmail.com>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    man/openrc-run.8: add missing "Xo" tags for fstabinfo and mountinfo.
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
    The BUILTINS are all surrounded by Xo...Xc tags, but the opening "Xo"
 | 
					 | 
				
			||||||
    was missing from the two commands fstabinfo and mountinfo. This commit
 | 
					 | 
				
			||||||
    adds them, and thereby fixes the spacing when viewed by man.
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
    This is for #204.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
commit 110582491ff02db061b567636a237460afbc489c
 | 
					 | 
				
			||||||
Author: William Hubbs <w.d.hubbs@gmail.com>
 | 
					 | 
				
			||||||
Commit: William Hubbs <w.d.hubbs@gmail.com>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    service-script-guide.md cleanups
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
    Refer to /var/run in the documentation instead of /run, and make it
 | 
					 | 
				
			||||||
    clear at the top of the pidfile section that we use /run under Linux.
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
    This is for #202.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
commit 5dd1d39d20c118064d31ed65dc7ae2de75dd7908
 | 
					 | 
				
			||||||
Author: William Hubbs <w.d.hubbs@gmail.com>
 | 
					 | 
				
			||||||
Commit: William Hubbs <w.d.hubbs@gmail.com>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    typo fix
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
commit 1771bc2a83fe65bfe6ec3e93ea7632609e697a38
 | 
					 | 
				
			||||||
Author: William Hubbs <w.d.hubbs@gmail.com>
 | 
					 | 
				
			||||||
Commit: William Hubbs <w.d.hubbs@gmail.com>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    checkpath: use fchown and fchmod to handle ownership and mode changes
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
    This is related to #195.
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
    This is an attempt to shorten the window for the first two issues
 | 
					 | 
				
			||||||
    discussed by using a file descriptor which does not follow symbolic
 | 
					 | 
				
			||||||
    links and using the fchmod and fchown calls instead of chown and chmod.
 | 
					 | 
				
			||||||
    with.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
commit 87c98ebb01873120eecc1757e615b3a4c14a2f1f
 | 
					 | 
				
			||||||
Author: William Hubbs <w.d.hubbs@gmail.com>
 | 
					 | 
				
			||||||
Commit: William Hubbs <w.d.hubbs@gmail.com>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    checkpath: fix lchown error message
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
    X-Gentoo-Bug: 643084
 | 
					 | 
				
			||||||
    X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=643084
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
commit 4af5a80b0c516773286cc30e743dc90a2d19df23
 | 
					 | 
				
			||||||
Author: William Hubbs <w.d.hubbs@gmail.com>
 | 
					 | 
				
			||||||
Commit: William Hubbs <w.d.hubbs@gmail.com>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    _rc_deptree_load - return NULL if the stat() call is not successful
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
    X-Gentoo-Bug: 643084
 | 
					 | 
				
			||||||
    X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=643084
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
commit fee2ffe559bc39beec16585daf557b902a53137b
 | 
					 | 
				
			||||||
Author: William Hubbs <w.d.hubbs@gmail.com>
 | 
					 | 
				
			||||||
Commit: William Hubbs <w.d.hubbs@gmail.com>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Reformat and fix titles in documentation
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
commit 8878f8916b7682a333d1e40af991cd7354192be1
 | 
					 | 
				
			||||||
Author: William Hubbs <w.d.hubbs@gmail.com>
 | 
					 | 
				
			||||||
Commit: William Hubbs <w.d.hubbs@gmail.com>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Rename guide.md to user-guide.md to better describe its purpose
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
commit 14e3359a9e4174da3e422957d9de56907f025875
 | 
					 | 
				
			||||||
Author: William Hubbs <w.d.hubbs@gmail.com>
 | 
					 | 
				
			||||||
Commit: William Hubbs <w.d.hubbs@gmail.com>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    move developer documentation from guide.md to service-script-guide.md
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
commit 918d955fd2de1f594b83508f5ddd5271534e3591
 | 
					 | 
				
			||||||
Author: William Hubbs <w.d.hubbs@gmail.com>
 | 
					 | 
				
			||||||
Commit: William Hubbs <w.d.hubbs@gmail.com>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    checkpath: use lchown instead of chown
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
    Checkpath should never follow symbolic links when changing ownership of a file.
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
    This is for https://github.com/openrc/openrc/issues/195.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
commit 92cfa0e543d380ab290d06e98e2fef1b283349fe
 | 
					 | 
				
			||||||
Author: William Hubbs <w.d.hubbs@gmail.com>
 | 
					 | 
				
			||||||
Commit: William Hubbs <w.d.hubbs@gmail.com>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    service-script-guide.md: formatting changes
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
    Add a title, adjust the headings and update the example that referred to
 | 
					 | 
				
			||||||
    "net.lo" to refer to "loopback".
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
commit c2bd33e4838eb56bebe2707f6ca6bd05e9df5b24
 | 
					 | 
				
			||||||
Author: Michael Orlitzky <michael@orlitzky.com>
 | 
					 | 
				
			||||||
Commit: William Hubbs <w.d.hubbs@gmail.com>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    service-script-guide.md: new guide for service script authors.
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
    This fixes #162.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
commit f42ec82f21f3760b829507344ad0ae761e1d59aa
 | 
					 | 
				
			||||||
Author: 3PO <r2d2@freakmail.de>
 | 
					 | 
				
			||||||
Commit: William Hubbs <w.d.hubbs@gmail.com>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    net-online: only process symbolic links in /sys/class/net
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
    The /sys/class/net directory contains files which are not symlinks if
 | 
					 | 
				
			||||||
    the system has bonded devices [1].  We should ignore these files.
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
    This fixes #196.
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
    [1] https://elkano.org/blog/manage-interface-bondings-sysfs-interface/
 | 
					 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										3
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										3
									
								
								Makefile
									
									
									
									
									
								
							@@ -33,8 +33,9 @@ ifeq (${MKZSHCOMP},yes)
 | 
				
			|||||||
SUBDIR+=	zsh-completion
 | 
					SUBDIR+=	zsh-completion
 | 
				
			||||||
endif
 | 
					endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# We need to ensure that runlevels is done last
 | 
					# We need to ensure that runlevels is done last other than test
 | 
				
			||||||
SUBDIR+=	runlevels
 | 
					SUBDIR+=	runlevels
 | 
				
			||||||
 | 
					SUBDIR+=	test
 | 
				
			||||||
 | 
					
 | 
				
			||||||
INSTALLAFTER=	_installafter
 | 
					INSTALLAFTER=	_installafter
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,3 +1,3 @@
 | 
				
			|||||||
NAME=		openrc
 | 
					NAME=		openrc
 | 
				
			||||||
VERSION=	0.40.3
 | 
					VERSION=	0.41.2
 | 
				
			||||||
PKG=		${NAME}-${VERSION}
 | 
					PKG=		${NAME}-${VERSION}
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										12
									
								
								NEWS.md
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								NEWS.md
									
									
									
									
									
								
							@@ -4,6 +4,18 @@ OpenRC NEWS
 | 
				
			|||||||
This file will contain a list of notable changes for each release. Note
 | 
					This file will contain a list of notable changes for each release. Note
 | 
				
			||||||
the information in this file is in reverse order.
 | 
					the information in this file is in reverse order.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					## OpenRC 0.41.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					This version adds the ability to format the output of rc-status when
 | 
				
			||||||
 | 
					showing the status of services in a runlevel so that it may be parsed.
 | 
				
			||||||
 | 
					Currently, the -f switch only accepts ini as an argument which
 | 
				
			||||||
 | 
					causes the output to be in the .ini format.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					This version adds an experimental build time switch to allow setting the
 | 
				
			||||||
 | 
					default shell to use for service scripts.
 | 
				
			||||||
 | 
					By default, this is set to /bin/sh if it is changed, the new shell must
 | 
				
			||||||
 | 
					be able to understand posix-compatible syntax.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
## OpenRC 0.40
 | 
					## OpenRC 0.40
 | 
				
			||||||
 | 
					
 | 
				
			||||||
In this version, the keymaps and termencoding services on Linux needed
 | 
					In this version, the keymaps and termencoding services on Linux needed
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -38,6 +38,7 @@ PKG_PREFIX=/usr/pkg
 | 
				
			|||||||
LOCAL_PREFIX=/usr/local
 | 
					LOCAL_PREFIX=/usr/local
 | 
				
			||||||
PREFIX=/usr/local
 | 
					PREFIX=/usr/local
 | 
				
			||||||
BRANDING=\"Gentoo/$(uname -s)\"
 | 
					BRANDING=\"Gentoo/$(uname -s)\"
 | 
				
			||||||
 | 
					SH=/bin/sh
 | 
				
			||||||
```
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
## Notes
 | 
					## Notes
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -91,11 +91,14 @@ _rc_service()
 | 
				
			|||||||
			done))
 | 
								done))
 | 
				
			||||||
			return 0
 | 
								return 0
 | 
				
			||||||
		elif [[ ${COMP_CWORD} -eq 2 ]] && [[ ${prev} != -* ]]; then # if second word typed and we didn't type in a function
 | 
							elif [[ ${COMP_CWORD} -eq 2 ]] && [[ ${prev} != -* ]]; then # if second word typed and we didn't type in a function
 | 
				
			||||||
			filename=$(rc-service --resolve ${prev})
 | 
								rc-service --exists "$prev" || return
 | 
				
			||||||
			opts=$(cat ${filename} | grep "^\w*()" | sed "s/().*$//")	# Greps the functions included in the init script
 | 
								shopt -s extglob
 | 
				
			||||||
			if [[ "x${opts}" == "x" ]] ; then			   # if no options found loosen the grep algorhythm
 | 
								while read -r _ line; do
 | 
				
			||||||
				opts=$(cat ${filename} | grep "\w*()" | sed "s/().*$//")
 | 
									if [[ $line == +([[:alnum:]_]):* ]]; then
 | 
				
			||||||
			fi
 | 
										opts+="${line%%:*} "
 | 
				
			||||||
 | 
									fi
 | 
				
			||||||
 | 
								done < <(rc-service "$prev" describe 2>&1)
 | 
				
			||||||
 | 
								shopt -u extglob
 | 
				
			||||||
			COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
 | 
								COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
 | 
				
			||||||
			return 0
 | 
								return 0
 | 
				
			||||||
		fi
 | 
							fi
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										21
									
								
								ci/cirrus.sh
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										21
									
								
								ci/cirrus.sh
									
									
									
									
									
										Executable file
									
								
							@@ -0,0 +1,21 @@
 | 
				
			|||||||
 | 
					#!/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 Cirrus CI under a jailed FreeBSD system.
 | 
				
			||||||
 | 
					# See $TOP/.cirrus.yml for more info about the Cirrus CI setup.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					cpus=$(getconf NPROCESSORS_CONF || echo 1)
 | 
				
			||||||
 | 
					gmake -j"${cpus}" -O
 | 
				
			||||||
 | 
					gmake test
 | 
				
			||||||
@@ -1,4 +1,4 @@
 | 
				
			|||||||
#!@SHELL@
 | 
					#!/bin/sh
 | 
				
			||||||
# Copyright (c) 2007-2015 The OpenRC Authors.
 | 
					# Copyright (c) 2007-2015 The OpenRC Authors.
 | 
				
			||||||
# See the Authors file at the top-level directory of this distribution and
 | 
					# See the Authors file at the top-level directory of this distribution and
 | 
				
			||||||
# https://github.com/OpenRC/openrc/blob/master/AUTHORS
 | 
					# https://github.com/OpenRC/openrc/blob/master/AUTHORS
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,4 +1,4 @@
 | 
				
			|||||||
#!@SHELL@
 | 
					#!/bin/sh
 | 
				
			||||||
# Copyright (c) 2007-2015 The OpenRC Authors.
 | 
					# Copyright (c) 2007-2015 The OpenRC Authors.
 | 
				
			||||||
# See the Authors file at the top-level directory of this distribution and
 | 
					# See the Authors file at the top-level directory of this distribution and
 | 
				
			||||||
# https://github.com/OpenRC/openrc/blob/master/AUTHORS
 | 
					# https://github.com/OpenRC/openrc/blob/master/AUTHORS
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -17,15 +17,35 @@
 | 
				
			|||||||
.Sh SYNOPSIS
 | 
					.Sh SYNOPSIS
 | 
				
			||||||
.Nm
 | 
					.Nm
 | 
				
			||||||
.Op Fl c , -cancel
 | 
					.Op Fl c , -cancel
 | 
				
			||||||
 | 
					.Nm
 | 
				
			||||||
 | 
					.Op Fl R , -reexec
 | 
				
			||||||
 | 
					.Nm
 | 
				
			||||||
 | 
					.Op Fl w , -write-only
 | 
				
			||||||
 | 
					.Nm
 | 
				
			||||||
.Op Fl d , -no-write
 | 
					.Op Fl d , -no-write
 | 
				
			||||||
.Op Fl D , -dry-run
 | 
					.Op Fl D , -dry-run
 | 
				
			||||||
.Op Fl H , -halt
 | 
					.Op Fl H , -halt
 | 
				
			||||||
 | 
					time
 | 
				
			||||||
 | 
					.Nm
 | 
				
			||||||
 | 
					.Op Fl d , -no-write
 | 
				
			||||||
 | 
					.Op Fl D , -dry-run
 | 
				
			||||||
.Op Fl k , -kexec
 | 
					.Op Fl k , -kexec
 | 
				
			||||||
 | 
					time
 | 
				
			||||||
 | 
					.Nm
 | 
				
			||||||
 | 
					.Op Fl d , -no-write
 | 
				
			||||||
 | 
					.Op Fl D , -dry-run
 | 
				
			||||||
.Op Fl p , -poweroff
 | 
					.Op Fl p , -poweroff
 | 
				
			||||||
.Op Fl R , -reexec
 | 
					time
 | 
				
			||||||
 | 
					.Nm
 | 
				
			||||||
 | 
					.Op Fl d , -no-write
 | 
				
			||||||
 | 
					.Op Fl D , -dry-run
 | 
				
			||||||
.Op Fl r , -reboot
 | 
					.Op Fl r , -reboot
 | 
				
			||||||
 | 
					time
 | 
				
			||||||
 | 
					.Nm
 | 
				
			||||||
 | 
					.Op Fl d , -no-write
 | 
				
			||||||
 | 
					.Op Fl D , -dry-run
 | 
				
			||||||
.Op Fl s , -single
 | 
					.Op Fl s , -single
 | 
				
			||||||
.Op Fl w , -write-only
 | 
					time
 | 
				
			||||||
.Sh DESCRIPTION
 | 
					.Sh DESCRIPTION
 | 
				
			||||||
.Nm
 | 
					.Nm
 | 
				
			||||||
is the utility that communicates with
 | 
					is the utility that communicates with
 | 
				
			||||||
@@ -56,7 +76,7 @@ Stop all services, kill all processes and reboot the system.
 | 
				
			|||||||
.It Fl s , -single
 | 
					.It Fl s , -single
 | 
				
			||||||
Stop all services, kill all processes and move to single user mode.
 | 
					Stop all services, kill all processes and move to single user mode.
 | 
				
			||||||
.It Fl w , -write-only
 | 
					.It Fl w , -write-only
 | 
				
			||||||
Stop all services, kill all processes and move to single user mode.
 | 
					Wrrite a wtmp shutdown record and do nothing else.
 | 
				
			||||||
.El
 | 
					.El
 | 
				
			||||||
.Sh SEE ALSO
 | 
					.Sh SEE ALSO
 | 
				
			||||||
.Xr openrc-init 8 ,
 | 
					.Xr openrc-init 8 ,
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -66,6 +66,7 @@ and
 | 
				
			|||||||
.Xr shutdown 8
 | 
					.Xr shutdown 8
 | 
				
			||||||
and let them call these special runlevels.
 | 
					and let them call these special runlevels.
 | 
				
			||||||
.Sh SEE ALSO
 | 
					.Sh SEE ALSO
 | 
				
			||||||
 | 
					.Xr openrc-run 8 ,
 | 
				
			||||||
.Xr rc-status 8 ,
 | 
					.Xr rc-status 8 ,
 | 
				
			||||||
.Xr rc-update 8 ,
 | 
					.Xr rc-update 8 ,
 | 
				
			||||||
.Xr init 8 ,
 | 
					.Xr init 8 ,
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -17,6 +17,7 @@
 | 
				
			|||||||
.Sh SYNOPSIS
 | 
					.Sh SYNOPSIS
 | 
				
			||||||
.Nm
 | 
					.Nm
 | 
				
			||||||
.Op Fl aclsuC
 | 
					.Op Fl aclsuC
 | 
				
			||||||
 | 
					.Op Fl f Ar ini
 | 
				
			||||||
.Op Ar runlevel
 | 
					.Op Ar runlevel
 | 
				
			||||||
.Sh DESCRIPTION
 | 
					.Sh DESCRIPTION
 | 
				
			||||||
.Nm
 | 
					.Nm
 | 
				
			||||||
@@ -37,6 +38,9 @@ The options are as follows:
 | 
				
			|||||||
Show all runlevels and their services.
 | 
					Show all runlevels and their services.
 | 
				
			||||||
.It Fl c , -crashed
 | 
					.It Fl c , -crashed
 | 
				
			||||||
List all services that have crashed.
 | 
					List all services that have crashed.
 | 
				
			||||||
 | 
					.It Fl f , -format
 | 
				
			||||||
 | 
					Select a format for the output. Currently, the only one that can be
 | 
				
			||||||
 | 
					specified is ini, which outputs in *.ini format.
 | 
				
			||||||
.It Fl l , -list
 | 
					.It Fl l , -list
 | 
				
			||||||
List all defined runlevels.
 | 
					List all defined runlevels.
 | 
				
			||||||
.It Fl m , -manual
 | 
					.It Fl m , -manual
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -9,7 +9,7 @@
 | 
				
			|||||||
.\"    except according to the terms contained in the LICENSE file.
 | 
					.\"    except according to the terms contained in the LICENSE file.
 | 
				
			||||||
.\"
 | 
					.\"
 | 
				
			||||||
.Dd April 27, 2016
 | 
					.Dd April 27, 2016
 | 
				
			||||||
.Dt supervise-DAEMON 8 SMM
 | 
					.Dt SUPERVISE-DAEMON 8 SMM
 | 
				
			||||||
.Os OpenRC
 | 
					.Os OpenRC
 | 
				
			||||||
.Sh NAME
 | 
					.Sh NAME
 | 
				
			||||||
.Nm supervise-daemon
 | 
					.Nm supervise-daemon
 | 
				
			||||||
@@ -88,16 +88,17 @@ owned by the user. You can optionally append a
 | 
				
			|||||||
name here also.
 | 
					name here also.
 | 
				
			||||||
.It Fl v , -verbose
 | 
					.It Fl v , -verbose
 | 
				
			||||||
Print the action(s) that are taken just before doing them.
 | 
					Print the action(s) that are taken just before doing them.
 | 
				
			||||||
 | 
					.El
 | 
				
			||||||
.Pp
 | 
					.Pp
 | 
				
			||||||
The options are as follows:
 | 
					The options are as follows:
 | 
				
			||||||
.Bl -tag -width indent
 | 
					.Bl -tag -width indent
 | 
				
			||||||
.Fl a , -healthcheck-timer Ar seconds
 | 
					.It Fl a , -healthcheck-timer Ar seconds
 | 
				
			||||||
Run the healthcheck() command, possibly followed by the unhealthy()
 | 
					Run the healthcheck() command, possibly followed by the unhealthy()
 | 
				
			||||||
command every time this number of seconds passes.
 | 
					command every time this number of seconds passes.
 | 
				
			||||||
.Fl A , -healthcheck-delay Ar seconds
 | 
					.It Fl A , -healthcheck-delay Ar seconds
 | 
				
			||||||
Wait this long before the first health check.
 | 
					Wait this long before the first health check.
 | 
				
			||||||
.It Fl D , -respawn-delay Ar seconds
 | 
					.It Fl D , -respawn-delay Ar seconds
 | 
				
			||||||
wait this number of seconds before restarting a daemon after it crashes.
 | 
					Wait this number of seconds before restarting a daemon after it crashes.
 | 
				
			||||||
The default is 0.
 | 
					The default is 0.
 | 
				
			||||||
.It Fl d , -chdir Ar path
 | 
					.It Fl d , -chdir Ar path
 | 
				
			||||||
chdir to this directory before starting the daemon.
 | 
					chdir to this directory before starting the daemon.
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -11,7 +11,7 @@
 | 
				
			|||||||
SFX=		.Linux.in
 | 
					SFX=		.Linux.in
 | 
				
			||||||
PKG_PREFIX?=	/usr
 | 
					PKG_PREFIX?=	/usr
 | 
				
			||||||
 | 
					
 | 
				
			||||||
CPPFLAGS+=	-D_DEFAULT_SOURCE -D_POSIX_C_SOURCE=200809L
 | 
					CPPFLAGS+=	-D_DEFAULT_SOURCE -D_POSIX_C_SOURCE=200809L -D_BSD_SOURCE -D_XOPEN_SOURCE
 | 
				
			||||||
LIBDL=		-Wl,-Bdynamic -ldl
 | 
					LIBDL=		-Wl,-Bdynamic -ldl
 | 
				
			||||||
 | 
					
 | 
				
			||||||
ifeq (${MKSELINUX},yes)
 | 
					ifeq (${MKSELINUX},yes)
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -19,7 +19,7 @@ _PKG_SED:=		$(shell ${_PKG_SED_SH})
 | 
				
			|||||||
_LCL_SED_SH=		if test "${PREFIX}" = "${LOCAL_PREFIX}"; then echo "-e 's:@LOCAL_PREFIX@::g'"; else echo "-e 's:@LOCAL_PREFIX@:${LOCAL_PREFIX}:g'"; fi
 | 
					_LCL_SED_SH=		if test "${PREFIX}" = "${LOCAL_PREFIX}"; then echo "-e 's:@LOCAL_PREFIX@::g'"; else echo "-e 's:@LOCAL_PREFIX@:${LOCAL_PREFIX}:g'"; fi
 | 
				
			||||||
_LCL_SED:=		$(shell ${_LCL_SED_SH})
 | 
					_LCL_SED:=		$(shell ${_LCL_SED_SH})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
SED_REPLACE=		-e 's:@SHELL@:${SH}:g' -e 's:@LIB@:${LIBNAME}:g' -e 's:@SYSCONFDIR@:${SYSCONFDIR}:g' -e 's:@LIBEXECDIR@:${LIBEXECDIR}:g' -e 's:@PREFIX@:${PREFIX}:g' -e 's:@BINDIR@:${BINDIR}:g' -e 's:@SBINDIR@:${SBINDIR}:g' ${_PKG_SED} ${_LCL_SED}
 | 
					SED_REPLACE=		-e 's:@SHELL@:${SH}:' -e 's:@LIB@:${LIBNAME}:g' -e 's:@SYSCONFDIR@:${SYSCONFDIR}:g' -e 's:@LIBEXECDIR@:${LIBEXECDIR}:g' -e 's:@PREFIX@:${PREFIX}:g' -e 's:@BINDIR@:${BINDIR}:g' -e 's:@SBINDIR@:${SBINDIR}:g' ${_PKG_SED} ${_LCL_SED}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Tweak our shell scripts
 | 
					# Tweak our shell scripts
 | 
				
			||||||
%.sh: %.sh.in
 | 
					%.sh: %.sh.in
 | 
				
			||||||
@@ -53,7 +53,6 @@ realinstall: ${BIN} ${CONF} ${INC}
 | 
				
			|||||||
install: all realinstall ${INSTALLAFTER}
 | 
					install: all realinstall ${INSTALLAFTER}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
check test::
 | 
					check test::
 | 
				
			||||||
	@if test -e runtests.sh ; then ./runtests.sh || exit $$? ; fi
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
# A lot of scripts don't have anything to clean
 | 
					# A lot of scripts don't have anything to clean
 | 
				
			||||||
# Also, some rm implentation require a file argument regardless of error
 | 
					# Also, some rm implentation require a file argument regardless of error
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,4 +1,4 @@
 | 
				
			|||||||
#!@SHELL@
 | 
					#!/bin/sh
 | 
				
			||||||
 | 
					
 | 
				
			||||||
option_arg=
 | 
					option_arg=
 | 
				
			||||||
poweroff_arg=
 | 
					poweroff_arg=
 | 
				
			||||||
@@ -21,4 +21,9 @@ if [ -z "${poweroff_arg}" ]; then
 | 
				
			|||||||
	poweroff_arg=--poweroff
 | 
						poweroff_arg=--poweroff
 | 
				
			||||||
fi
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
exec @SBINDIR@/openrc-shutdown ${option_arg} ${poweroff_arg} "$@"
 | 
					script_args="$@"
 | 
				
			||||||
 | 
					if [ -z "${script_args}" ]; then
 | 
				
			||||||
 | 
						script_args=now
 | 
				
			||||||
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					exec @SBINDIR@/openrc-shutdown ${option_arg} ${poweroff_arg} "${script_args}"
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,4 +1,4 @@
 | 
				
			|||||||
#!@SHELL@
 | 
					#!/bin/sh
 | 
				
			||||||
 | 
					
 | 
				
			||||||
option_arg=
 | 
					option_arg=
 | 
				
			||||||
poweroff_arg=
 | 
					poweroff_arg=
 | 
				
			||||||
@@ -20,4 +20,9 @@ if [ -z "${poweroff_arg}" ]; then
 | 
				
			|||||||
	poweroff_arg=--poweroff
 | 
						poweroff_arg=--poweroff
 | 
				
			||||||
fi
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
exec @SBINDIR@/openrc-shutdown ${option_arg} ${poweroff_arg} "$@"
 | 
					script_args="$@"
 | 
				
			||||||
 | 
					if [ -z "${script_args}" ]; then
 | 
				
			||||||
 | 
						script_args=now
 | 
				
			||||||
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					exec @SBINDIR@/openrc-shutdown ${option_arg} ${poweroff_arg} "${script_args}"
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,4 +1,4 @@
 | 
				
			|||||||
#!@SHELL@
 | 
					#!/bin/sh
 | 
				
			||||||
# Copyright (c) 2015 The OpenRC Authors.
 | 
					# Copyright (c) 2015 The OpenRC Authors.
 | 
				
			||||||
# See the Authors file at the top-level directory of this distribution and
 | 
					# See the Authors file at the top-level directory of this distribution and
 | 
				
			||||||
# https://github.com/OpenRC/openrc/blob/master/AUTHORS
 | 
					# https://github.com/OpenRC/openrc/blob/master/AUTHORS
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,4 +1,4 @@
 | 
				
			|||||||
#!@SHELL@
 | 
					#!/bin/sh
 | 
				
			||||||
 | 
					
 | 
				
			||||||
option_arg=
 | 
					option_arg=
 | 
				
			||||||
poweroff_arg=
 | 
					poweroff_arg=
 | 
				
			||||||
@@ -22,4 +22,9 @@ if [ -z "${poweroff_arg}" ]; then
 | 
				
			|||||||
	poweroff_arg=--reboot
 | 
						poweroff_arg=--reboot
 | 
				
			||||||
fi
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
exec @SBINDIR@/openrc-shutdown ${option_arg} ${poweroff_arg} "$@"
 | 
					script_args="$@"
 | 
				
			||||||
 | 
					if [ -z "${script_args}" ]; then
 | 
				
			||||||
 | 
						script_args=now
 | 
				
			||||||
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					exec @SBINDIR@/openrc-shutdown ${option_arg} ${poweroff_arg} "${script_args}"
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,4 +1,4 @@
 | 
				
			|||||||
#!@SHELL@
 | 
					#!/bin/sh
 | 
				
			||||||
 | 
					
 | 
				
			||||||
shutdown_arg=
 | 
					shutdown_arg=
 | 
				
			||||||
while getopts :akrhPHfFnct: opt; do
 | 
					while getopts :akrhPHfFnct: opt; do
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										2
									
								
								sh/.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								sh/.gitignore
									
									
									
									
										vendored
									
									
								
							@@ -4,6 +4,4 @@ openrc-run.sh
 | 
				
			|||||||
cgroup-release-agent.sh
 | 
					cgroup-release-agent.sh
 | 
				
			||||||
init.sh
 | 
					init.sh
 | 
				
			||||||
init-early.sh
 | 
					init-early.sh
 | 
				
			||||||
rc-cgroup.sh
 | 
					 | 
				
			||||||
migrate-to-run.sh
 | 
					 | 
				
			||||||
binfmt.sh
 | 
					binfmt.sh
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										10
									
								
								sh/Makefile
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								sh/Makefile
									
									
									
									
									
								
							@@ -2,7 +2,7 @@ DIR=	${LIBEXECDIR}/sh
 | 
				
			|||||||
SRCS=	init.sh.in functions.sh.in gendepends.sh.in \
 | 
					SRCS=	init.sh.in functions.sh.in gendepends.sh.in \
 | 
				
			||||||
	openrc-run.sh.in ${SRCS-${OS}}
 | 
						openrc-run.sh.in ${SRCS-${OS}}
 | 
				
			||||||
INC=	rc-mount.sh functions.sh rc-functions.sh runit.sh s6.sh \
 | 
					INC=	rc-mount.sh functions.sh rc-functions.sh runit.sh s6.sh \
 | 
				
			||||||
		start-stop-daemon.sh supervise-daemon.sh
 | 
							start-stop-daemon.sh supervise-daemon.sh ${INC-${OS}}
 | 
				
			||||||
BIN=	gendepends.sh init.sh openrc-run.sh ${BIN-${OS}}
 | 
					BIN=	gendepends.sh init.sh openrc-run.sh ${BIN-${OS}}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
INSTALLAFTER=	_installafter
 | 
					INSTALLAFTER=	_installafter
 | 
				
			||||||
@@ -13,10 +13,9 @@ include ${MK}/os.mk
 | 
				
			|||||||
SRCS-FreeBSD=
 | 
					SRCS-FreeBSD=
 | 
				
			||||||
BIN-FreeBSD=
 | 
					BIN-FreeBSD=
 | 
				
			||||||
 | 
					
 | 
				
			||||||
SRCS-Linux=	binfmt.sh.in cgroup-release-agent.sh.in init-early.sh.in \
 | 
					SRCS-Linux=	binfmt.sh.in cgroup-release-agent.sh.in init-early.sh.in
 | 
				
			||||||
	migrate-to-run.sh.in rc-cgroup.sh.in
 | 
					BIN-Linux=	binfmt.sh cgroup-release-agent.sh init-early.sh
 | 
				
			||||||
BIN-Linux=	binfmt.sh cgroup-release-agent.sh init-early.sh migrate-to-run.sh \
 | 
					INC-Linux= rc-cgroup.sh
 | 
				
			||||||
	rc-cgroup.sh
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
SRCS-NetBSD=
 | 
					SRCS-NetBSD=
 | 
				
			||||||
BIN-NetBSD=
 | 
					BIN-NetBSD=
 | 
				
			||||||
@@ -32,4 +31,3 @@ _installafter:
 | 
				
			|||||||
	ln -snf ${LIBEXECDIR}/sh/functions.sh ${DESTDIR}/${INITDIR} || exit $$?
 | 
						ln -snf ${LIBEXECDIR}/sh/functions.sh ${DESTDIR}/${INITDIR} || exit $$?
 | 
				
			||||||
 | 
					
 | 
				
			||||||
check test::
 | 
					check test::
 | 
				
			||||||
	./runtests.sh
 | 
					 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,4 +1,4 @@
 | 
				
			|||||||
#!@SHELL@
 | 
					#!/bin/sh
 | 
				
			||||||
# This is a reimplementation of the systemd binfmt.d code to register
 | 
					# This is a reimplementation of the systemd binfmt.d code to register
 | 
				
			||||||
# misc binary formats with the kernel.
 | 
					# misc binary formats with the kernel.
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,4 +1,4 @@
 | 
				
			|||||||
#!@SHELL@
 | 
					#!/bin/sh
 | 
				
			||||||
# This is run by the kernel after the last task is removed from a
 | 
					# This is run by the kernel after the last task is removed from a
 | 
				
			||||||
# control group in the openrc hierarchy.
 | 
					# control group in the openrc hierarchy.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,4 +1,4 @@
 | 
				
			|||||||
#!@SHELL@
 | 
					#!/bin/sh
 | 
				
			||||||
# Copyright (c) 2007-2015 The OpenRC Authors.
 | 
					# Copyright (c) 2007-2015 The OpenRC Authors.
 | 
				
			||||||
# See the Authors file at the top-level directory of this distribution and
 | 
					# See the Authors file at the top-level directory of this distribution and
 | 
				
			||||||
# https://github.com/OpenRC/openrc/blob/master/AUTHORS
 | 
					# https://github.com/OpenRC/openrc/blob/master/AUTHORS
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,4 +1,4 @@
 | 
				
			|||||||
#!@SHELL@
 | 
					#!/bin/sh
 | 
				
			||||||
# Copyright (c) 2007-2015 The OpenRC Authors.
 | 
					# Copyright (c) 2007-2015 The OpenRC Authors.
 | 
				
			||||||
# See the Authors file at the top-level directory of this distribution and
 | 
					# See the Authors file at the top-level directory of this distribution and
 | 
				
			||||||
# https://github.com/OpenRC/openrc/blob/master/AUTHORS
 | 
					# https://github.com/OpenRC/openrc/blob/master/AUTHORS
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,4 +1,4 @@
 | 
				
			|||||||
#!@SHELL@
 | 
					#!/bin/sh
 | 
				
			||||||
# Copyright (c) 2007-2015 The OpenRC Authors.
 | 
					# Copyright (c) 2007-2015 The OpenRC Authors.
 | 
				
			||||||
# See the Authors file at the top-level directory of this distribution and
 | 
					# See the Authors file at the top-level directory of this distribution and
 | 
				
			||||||
# https://github.com/OpenRC/openrc/blob/master/AUTHORS
 | 
					# https://github.com/OpenRC/openrc/blob/master/AUTHORS
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,4 +1,4 @@
 | 
				
			|||||||
#!@SHELL@
 | 
					#!/bin/sh
 | 
				
			||||||
# Copyright (c) 2007-2015 The OpenRC Authors.
 | 
					# Copyright (c) 2007-2015 The OpenRC Authors.
 | 
				
			||||||
# See the Authors file at the top-level directory of this distribution and
 | 
					# See the Authors file at the top-level directory of this distribution and
 | 
				
			||||||
# https://github.com/OpenRC/openrc/blob/master/AUTHORS
 | 
					# https://github.com/OpenRC/openrc/blob/master/AUTHORS
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,4 +1,4 @@
 | 
				
			|||||||
#!@SHELL@
 | 
					#!/bin/sh
 | 
				
			||||||
# Copyright (c) 1999-2007 Gentoo Foundation
 | 
					# Copyright (c) 1999-2007 Gentoo Foundation
 | 
				
			||||||
# Copyright (c) 2007-2009 Roy Marples <roy@marples.name>
 | 
					# Copyright (c) 2007-2009 Roy Marples <roy@marples.name>
 | 
				
			||||||
# Released under the 2-clause BSD license.
 | 
					# Released under the 2-clause BSD license.
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,36 +0,0 @@
 | 
				
			|||||||
#!@SHELL@
 | 
					 | 
				
			||||||
# Copyright (c) 2012-2015 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.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
. "@LIBEXECDIR@/sh/functions.sh"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
if [ -e /run/openrc/softlevel ]; then
 | 
					 | 
				
			||||||
	einfo "The OpenRC dependency data has already been migrated."
 | 
					 | 
				
			||||||
	exit 0
 | 
					 | 
				
			||||||
fi
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
if [ ! -d /run ]; then
 | 
					 | 
				
			||||||
	eerror "/run is not a directory."
 | 
					 | 
				
			||||||
	eerror "moving /run to /run.pre-openrc"
 | 
					 | 
				
			||||||
	mv /run /run.pre-openrc
 | 
					 | 
				
			||||||
	mkdir /run
 | 
					 | 
				
			||||||
fi
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
rm -rf /run/openrc
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
if ! mountinfo -q -f tmpfs /run; then
 | 
					 | 
				
			||||||
	ln -s "@LIBEXECDIR@"/init.d /run/openrc
 | 
					 | 
				
			||||||
else
 | 
					 | 
				
			||||||
	cp -a "@LIBEXECDIR@/init.d" /run/openrc
 | 
					 | 
				
			||||||
	rc-update -u
 | 
					 | 
				
			||||||
fi
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
einfo "The OpenRC dependency data was migrated successfully."
 | 
					 | 
				
			||||||
exit 0
 | 
					 | 
				
			||||||
@@ -1,4 +1,3 @@
 | 
				
			|||||||
#!@SHELL@
 | 
					 | 
				
			||||||
# Copyright (c) 2012-2015 The OpenRC Authors.
 | 
					# Copyright (c) 2012-2015 The OpenRC Authors.
 | 
				
			||||||
# See the Authors file at the top-level directory of this distribution and
 | 
					# See the Authors file at the top-level directory of this distribution and
 | 
				
			||||||
# https://github.com/OpenRC/openrc/blob/master/AUTHORS
 | 
					# https://github.com/OpenRC/openrc/blob/master/AUTHORS
 | 
				
			||||||
@@ -1,7 +1,7 @@
 | 
				
			|||||||
# Copyright (c) 2007-2008 Roy Marples <roy@marples.name>
 | 
					# Copyright (c) 2007-2008 Roy Marples <roy@marples.name>
 | 
				
			||||||
# Released under the 2-clause BSD license.
 | 
					# Released under the 2-clause BSD license.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
SUBDIR=		test libeinfo librc rc
 | 
					SUBDIR=		libeinfo librc rc
 | 
				
			||||||
 | 
					
 | 
				
			||||||
MK=		../mk
 | 
					MK=		../mk
 | 
				
			||||||
include		${MK}/subdir.mk
 | 
					include		${MK}/subdir.mk
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -59,7 +59,7 @@ pid_is_argv(pid_t pid, const char *const *argv)
 | 
				
			|||||||
		free(cmdline);
 | 
							free(cmdline);
 | 
				
			||||||
		return false;
 | 
							return false;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	bytes = read(fd, buffer, sizeof(buffer));
 | 
						bytes = read(fd, buffer, sizeof(buffer) - 1);
 | 
				
			||||||
	close(fd);
 | 
						close(fd);
 | 
				
			||||||
	free(cmdline);
 | 
						free(cmdline);
 | 
				
			||||||
	if (bytes == -1)
 | 
						if (bytes == -1)
 | 
				
			||||||
@@ -141,7 +141,7 @@ rc_find_pids(const char *exec, const char *const *argv, uid_t uid, pid_t pid)
 | 
				
			|||||||
	memset(my_ns, 0, sizeof(my_ns));
 | 
						memset(my_ns, 0, sizeof(my_ns));
 | 
				
			||||||
	memset(proc_ns, 0, sizeof(proc_ns));
 | 
						memset(proc_ns, 0, sizeof(proc_ns));
 | 
				
			||||||
	if (exists("/proc/self/ns/pid")) {
 | 
						if (exists("/proc/self/ns/pid")) {
 | 
				
			||||||
		rc = readlink("/proc/self/ns/pid", my_ns, sizeof(my_ns));
 | 
							rc = readlink("/proc/self/ns/pid", my_ns, sizeof(my_ns)-1);
 | 
				
			||||||
		if (rc <= 0)
 | 
							if (rc <= 0)
 | 
				
			||||||
			my_ns[0] = '\0';
 | 
								my_ns[0] = '\0';
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
@@ -155,7 +155,7 @@ rc_find_pids(const char *exec, const char *const *argv, uid_t uid, pid_t pid)
 | 
				
			|||||||
			continue;
 | 
								continue;
 | 
				
			||||||
		xasprintf(&buffer, "/proc/%d/ns/pid", p);
 | 
							xasprintf(&buffer, "/proc/%d/ns/pid", p);
 | 
				
			||||||
		if (exists(buffer)) {
 | 
							if (exists(buffer)) {
 | 
				
			||||||
			rc = readlink(buffer, proc_ns, sizeof(proc_ns));
 | 
								rc = readlink(buffer, proc_ns, sizeof(proc_ns)-1);
 | 
				
			||||||
			if (rc <= 0)
 | 
								if (rc <= 0)
 | 
				
			||||||
				proc_ns[0] = '\0';
 | 
									proc_ns[0] = '\0';
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -84,10 +84,11 @@ static RC_DEPINFO *
 | 
				
			|||||||
get_depinfo(const RC_DEPTREE *deptree, const char *service)
 | 
					get_depinfo(const RC_DEPTREE *deptree, const char *service)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	RC_DEPINFO *di;
 | 
						RC_DEPINFO *di;
 | 
				
			||||||
 | 
						if (deptree) {
 | 
				
			||||||
	TAILQ_FOREACH(di, deptree, entries)
 | 
							TAILQ_FOREACH(di, deptree, entries)
 | 
				
			||||||
		if (strcmp(di->service, service) == 0)
 | 
								if (strcmp(di->service, service) == 0)
 | 
				
			||||||
			return di;
 | 
									return di;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
	return NULL;
 | 
						return NULL;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -96,9 +97,11 @@ get_deptype(const RC_DEPINFO *depinfo, const char *type)
 | 
				
			|||||||
{
 | 
					{
 | 
				
			||||||
	RC_DEPTYPE *dt;
 | 
						RC_DEPTYPE *dt;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	TAILQ_FOREACH(dt, &depinfo->depends, entries)
 | 
						if (depinfo) {
 | 
				
			||||||
		if (strcmp(dt->type, type) == 0)
 | 
							TAILQ_FOREACH(dt, &depinfo->depends, entries)
 | 
				
			||||||
			return dt;
 | 
								if (strcmp(dt->type, type) == 0)
 | 
				
			||||||
 | 
									return dt;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
	return NULL;
 | 
						return NULL;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -616,11 +619,11 @@ mtime_check(const char *source, const char *target, bool newer,
 | 
				
			|||||||
		return false;
 | 
							return false;
 | 
				
			||||||
	mtime = buf.st_mtime;
 | 
						mtime = buf.st_mtime;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    retval = deep_mtime_check(target,newer,&mtime,file);
 | 
						retval = deep_mtime_check(target,newer,&mtime,file);
 | 
				
			||||||
    if (rel) {
 | 
						if (rel) {
 | 
				
			||||||
        *rel = mtime;
 | 
							*rel = mtime;
 | 
				
			||||||
    }
 | 
						}
 | 
				
			||||||
    return retval;
 | 
						return retval;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
bool
 | 
					bool
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -423,7 +423,7 @@ rc_conf_value(const char *setting)
 | 
				
			|||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		rc_conf = rc_config_directory(rc_conf);
 | 
							rc_conf = rc_config_directory(rc_conf);
 | 
				
			||||||
	rc_conf = rc_config_kcl(rc_conf);
 | 
							rc_conf = rc_config_kcl(rc_conf);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		/* Convert old uppercase to lowercase */
 | 
							/* Convert old uppercase to lowercase */
 | 
				
			||||||
		TAILQ_FOREACH(s, rc_conf, entries) {
 | 
							TAILQ_FOREACH(s, rc_conf, entries) {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -558,7 +558,7 @@ rc_service_resolve(const char *service)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	if (*file) {
 | 
						if (*file) {
 | 
				
			||||||
		memset(buffer, 0, sizeof(buffer));
 | 
							memset(buffer, 0, sizeof(buffer));
 | 
				
			||||||
		r = readlink(file, buffer, sizeof(buffer));
 | 
							r = readlink(file, buffer, sizeof(buffer)-1);
 | 
				
			||||||
		if (r > 0)
 | 
							if (r > 0)
 | 
				
			||||||
			return xstrdup(buffer);
 | 
								return xstrdup(buffer);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
@@ -1047,7 +1047,6 @@ rc_service_add(const char *runlevel, const char *service)
 | 
				
			|||||||
	char *init;
 | 
						char *init;
 | 
				
			||||||
	char file[PATH_MAX];
 | 
						char file[PATH_MAX];
 | 
				
			||||||
	char path[MAXPATHLEN] = { '\0' };
 | 
						char path[MAXPATHLEN] = { '\0' };
 | 
				
			||||||
	char *p = NULL;
 | 
					 | 
				
			||||||
	char binit[PATH_MAX];
 | 
						char binit[PATH_MAX];
 | 
				
			||||||
	char *i;
 | 
						char *i;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -1068,8 +1067,7 @@ rc_service_add(const char *runlevel, const char *service)
 | 
				
			|||||||
	/* We need to ensure that only things in /etc/init.d are added
 | 
						/* We need to ensure that only things in /etc/init.d are added
 | 
				
			||||||
	 * to the boot runlevel */
 | 
						 * to the boot runlevel */
 | 
				
			||||||
	if (strcmp(runlevel, RC_LEVEL_BOOT) == 0) {
 | 
						if (strcmp(runlevel, RC_LEVEL_BOOT) == 0) {
 | 
				
			||||||
		p = realpath(dirname(init), path);
 | 
							if (realpath(dirname(init), path) == NULL) {
 | 
				
			||||||
		if (!*p) {
 | 
					 | 
				
			||||||
			free(init);
 | 
								free(init);
 | 
				
			||||||
			return false;
 | 
								return false;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -37,10 +37,6 @@
 | 
				
			|||||||
# define _PATH_DEV	"/dev/"
 | 
					# define _PATH_DEV	"/dev/"
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#ifndef UT_LINESIZE
 | 
					 | 
				
			||||||
#define UT_LINESIZE __UT_LINESIZE
 | 
					 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
static sigjmp_buf jbuf;
 | 
					static sigjmp_buf jbuf;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
@@ -62,7 +58,7 @@ static void getuidtty(char **userp, char **ttyp)
 | 
				
			|||||||
	uid_t			uid;
 | 
						uid_t			uid;
 | 
				
			||||||
	char			*tty;
 | 
						char			*tty;
 | 
				
			||||||
	static char		uidbuf[32];
 | 
						static char		uidbuf[32];
 | 
				
			||||||
	static char		ttynm[UT_LINESIZE + 4];
 | 
						char		*ttynm = NULL;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	uid = getuid();
 | 
						uid = getuid();
 | 
				
			||||||
	if ((pwd = getpwuid(uid)) != NULL) {
 | 
						if ((pwd = getpwuid(uid)) != NULL) {
 | 
				
			||||||
@@ -82,10 +78,8 @@ static void getuidtty(char **userp, char **ttyp)
 | 
				
			|||||||
			if (tty[0] == '/')
 | 
								if (tty[0] == '/')
 | 
				
			||||||
				tty++;
 | 
									tty++;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		snprintf(ttynm, sizeof(ttynm), "(%.*s) ",
 | 
							xasprintf(&ttynm, "(%s) ", tty);
 | 
				
			||||||
				 UT_LINESIZE, tty);
 | 
						}
 | 
				
			||||||
	} else
 | 
					 | 
				
			||||||
		ttynm[0] = 0;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	*userp = uidbuf;
 | 
						*userp = uidbuf;
 | 
				
			||||||
	*ttyp  = ttynm;
 | 
						*ttyp  = ttynm;
 | 
				
			||||||
@@ -156,6 +150,7 @@ void broadcast(char *text)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	xasprintf(&line, "\007\r\nBroadcast message from %s@%s %s(%s):\r\n\r\n",
 | 
						xasprintf(&line, "\007\r\nBroadcast message from %s@%s %s(%s):\r\n\r\n",
 | 
				
			||||||
			user, name.nodename, tty, date);
 | 
								user, name.nodename, tty, date);
 | 
				
			||||||
 | 
						free(tty);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/*
 | 
						/*
 | 
				
			||||||
	 *	Fork to avoid hanging in a write()
 | 
						 *	Fork to avoid hanging in a write()
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -43,40 +43,45 @@
 | 
				
			|||||||
static const char *path_default = "/sbin:/usr/sbin:/bin:/usr/bin";
 | 
					static const char *path_default = "/sbin:/usr/sbin:/bin:/usr/bin";
 | 
				
			||||||
static const char *rc_default_runlevel = "default";
 | 
					static const char *rc_default_runlevel = "default";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static pid_t do_openrc(const char *runlevel)
 | 
					static void do_openrc(const char *runlevel)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	pid_t pid;
 | 
						pid_t pid;
 | 
				
			||||||
	sigset_t signals;
 | 
						sigset_t all_signals;
 | 
				
			||||||
 | 
						sigset_t our_signals;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						sigfillset(&all_signals);
 | 
				
			||||||
 | 
						/* block all signals */
 | 
				
			||||||
 | 
						sigprocmask(SIG_BLOCK, &all_signals, &our_signals);
 | 
				
			||||||
	pid = fork();
 | 
						pid = fork();
 | 
				
			||||||
	switch (pid) {
 | 
						switch (pid) {
 | 
				
			||||||
		case -1:
 | 
							case -1:
 | 
				
			||||||
			perror("fork");
 | 
								perror("fork");
 | 
				
			||||||
 | 
								exit(1);
 | 
				
			||||||
			break;
 | 
								break;
 | 
				
			||||||
		case 0:
 | 
							case 0:
 | 
				
			||||||
			setsid();
 | 
								setsid();
 | 
				
			||||||
			/* unblock all signals */
 | 
								/* unblock all signals */
 | 
				
			||||||
			sigemptyset(&signals);
 | 
								sigprocmask(SIG_UNBLOCK, &all_signals, NULL);
 | 
				
			||||||
			sigprocmask(SIG_SETMASK, &signals, NULL);
 | 
					 | 
				
			||||||
			printf("Starting %s runlevel\n", runlevel);
 | 
								printf("Starting %s runlevel\n", runlevel);
 | 
				
			||||||
			execlp("openrc", "openrc", runlevel, NULL);
 | 
								execlp("openrc", "openrc", runlevel, NULL);
 | 
				
			||||||
			perror("exec");
 | 
								perror("exec");
 | 
				
			||||||
 | 
								exit(1);
 | 
				
			||||||
			break;
 | 
								break;
 | 
				
			||||||
		default:
 | 
							default:
 | 
				
			||||||
 | 
								/* restore our signal mask */
 | 
				
			||||||
 | 
								sigprocmask(SIG_SETMASK, &our_signals, NULL);
 | 
				
			||||||
 | 
								while (waitpid(pid, NULL, 0) != pid)
 | 
				
			||||||
 | 
									if (errno == ECHILD)
 | 
				
			||||||
 | 
										break;
 | 
				
			||||||
			break;
 | 
								break;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	return pid;
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void init(const char *default_runlevel)
 | 
					static void init(const char *default_runlevel)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	const char *runlevel = NULL;
 | 
						const char *runlevel = NULL;
 | 
				
			||||||
	pid_t pid;
 | 
						do_openrc("sysinit");
 | 
				
			||||||
 | 
						do_openrc("boot");
 | 
				
			||||||
	pid = do_openrc("sysinit");
 | 
					 | 
				
			||||||
	waitpid(pid, NULL, 0);
 | 
					 | 
				
			||||||
	pid = do_openrc("boot");
 | 
					 | 
				
			||||||
	waitpid(pid, NULL, 0);
 | 
					 | 
				
			||||||
	if (default_runlevel)
 | 
						if (default_runlevel)
 | 
				
			||||||
		runlevel = default_runlevel;
 | 
							runlevel = default_runlevel;
 | 
				
			||||||
	else
 | 
						else
 | 
				
			||||||
@@ -87,8 +92,7 @@ static void init(const char *default_runlevel)
 | 
				
			|||||||
		printf("%s is an invalid runlevel\n", runlevel);
 | 
							printf("%s is an invalid runlevel\n", runlevel);
 | 
				
			||||||
		runlevel = rc_default_runlevel;
 | 
							runlevel = rc_default_runlevel;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	pid = do_openrc(runlevel);
 | 
						do_openrc(runlevel);
 | 
				
			||||||
	waitpid(pid, NULL, 0);
 | 
					 | 
				
			||||||
	log_wtmp("reboot", "~~", 0, RUN_LVL, "~~");
 | 
						log_wtmp("reboot", "~~", 0, RUN_LVL, "~~");
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -100,11 +104,9 @@ static void handle_reexec(char *my_name)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
static void handle_shutdown(const char *runlevel, int cmd)
 | 
					static void handle_shutdown(const char *runlevel, int cmd)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	pid_t pid;
 | 
					 | 
				
			||||||
	struct timespec ts;
 | 
						struct timespec ts;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	pid = do_openrc(runlevel);
 | 
						do_openrc(runlevel);
 | 
				
			||||||
	while (waitpid(pid, NULL, 0) != pid);
 | 
					 | 
				
			||||||
	printf("Sending the final term signal\n");
 | 
						printf("Sending the final term signal\n");
 | 
				
			||||||
	kill(-1, SIGTERM);
 | 
						kill(-1, SIGTERM);
 | 
				
			||||||
	ts.tv_sec = 3;
 | 
						ts.tv_sec = 3;
 | 
				
			||||||
@@ -118,10 +120,7 @@ static void handle_shutdown(const char *runlevel, int cmd)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
static void handle_single(void)
 | 
					static void handle_single(void)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	pid_t pid;
 | 
						do_openrc("single");
 | 
				
			||||||
 | 
					 | 
				
			||||||
	pid = do_openrc("single");
 | 
					 | 
				
			||||||
	while (waitpid(pid, NULL, 0) != pid);
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void reap_zombies(void)
 | 
					static void reap_zombies(void)
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1120,7 +1120,7 @@ int main(int argc, char **argv)
 | 
				
			|||||||
	char *dir, *save = NULL, *saveLnk = NULL;
 | 
						char *dir, *save = NULL, *saveLnk = NULL;
 | 
				
			||||||
	char *pidstr = NULL;
 | 
						char *pidstr = NULL;
 | 
				
			||||||
	size_t l = 0, ll;
 | 
						size_t l = 0, ll;
 | 
				
			||||||
 	const char *file;
 | 
						const char *file;
 | 
				
			||||||
	struct stat stbuf;
 | 
						struct stat stbuf;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/* Show help if insufficient args */
 | 
						/* Show help if insufficient args */
 | 
				
			||||||
@@ -1152,7 +1152,7 @@ int main(int argc, char **argv)
 | 
				
			|||||||
	}
 | 
						}
 | 
				
			||||||
	lnk = xmalloc(4096);
 | 
						lnk = xmalloc(4096);
 | 
				
			||||||
	memset(lnk, 0, 4096);
 | 
						memset(lnk, 0, 4096);
 | 
				
			||||||
	if (readlink(argv[1], lnk, 4096)) {
 | 
						if (readlink(argv[1], lnk, 4096-1)) {
 | 
				
			||||||
		dir = dirname(path);
 | 
							dir = dirname(path);
 | 
				
			||||||
		if (strchr(lnk, '/')) {
 | 
							if (strchr(lnk, '/')) {
 | 
				
			||||||
			save = xstrdup(dir);
 | 
								save = xstrdup(dir);
 | 
				
			||||||
@@ -1223,7 +1223,6 @@ int main(int argc, char **argv)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
		/* Make our prefix string */
 | 
							/* Make our prefix string */
 | 
				
			||||||
		prefix = xmalloc(sizeof(char) * l + 1);
 | 
							prefix = xmalloc(sizeof(char) * l + 1);
 | 
				
			||||||
		ll = strlen(applet);
 | 
					 | 
				
			||||||
		memcpy(prefix, applet, ll);
 | 
							memcpy(prefix, applet, ll);
 | 
				
			||||||
		memset(prefix + ll, ' ', l - ll);
 | 
							memset(prefix + ll, ' ', l - ll);
 | 
				
			||||||
		memset(prefix + l, 0, 1);
 | 
							memset(prefix + l, 0, 1);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -67,7 +67,15 @@ const char * const longopts_help[] = {
 | 
				
			|||||||
	"write wtmp boot record and exit",
 | 
						"write wtmp boot record and exit",
 | 
				
			||||||
	longopts_help_COMMON
 | 
						longopts_help_COMMON
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
const char *usagestring = NULL;
 | 
					const char *usagestring = "" \
 | 
				
			||||||
 | 
											   "Usage: openrc-shutdown -c | --cancel\n" \
 | 
				
			||||||
 | 
											   "   or: openrc-shutdown -R | --reexec\n" \
 | 
				
			||||||
 | 
											   "   or: openrc-shutdown -w | --write-only\n" \
 | 
				
			||||||
 | 
											   "   or: openmrc-shutdown -H | --halt time\n" \
 | 
				
			||||||
 | 
											   "   or: openrc-shutdown -K | --kexec time\n" \
 | 
				
			||||||
 | 
											   "   or: openrc-shutdown -p | --poweroff time\n" \
 | 
				
			||||||
 | 
											   "   or: openrc-shutdown -r | --reboot time\n" \
 | 
				
			||||||
 | 
											   "   or: openrc-shutdown -s | --single time";
 | 
				
			||||||
const char *exclusive = "Select one of "
 | 
					const char *exclusive = "Select one of "
 | 
				
			||||||
	"--cancel, --halt, --kexec, --poweroff, --reexec, --reboot, --single or \n"
 | 
						"--cancel, --halt, --kexec, --poweroff, --reexec, --reboot, --single or \n"
 | 
				
			||||||
	"--write-only";
 | 
						"--write-only";
 | 
				
			||||||
@@ -111,8 +119,8 @@ static void create_nologin(int mins)
 | 
				
			|||||||
	t += 60 * mins;
 | 
						t += 60 * mins;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if ((fp = fopen(nologin_file, "w")) != NULL) {
 | 
						if ((fp = fopen(nologin_file, "w")) != NULL) {
 | 
				
			||||||
  		fprintf(fp, "\rThe system is going down on %s\r\n", ctime(&t));
 | 
							fprintf(fp, "\rThe system is going down on %s\r\n", ctime(&t));
 | 
				
			||||||
  		fclose(fp);
 | 
							fclose(fp);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -122,7 +130,7 @@ static void create_nologin(int mins)
 | 
				
			|||||||
static void send_cmd(const char *cmd)
 | 
					static void send_cmd(const char *cmd)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	FILE *fifo;
 | 
						FILE *fifo;
 | 
				
			||||||
 	size_t ignored;
 | 
						size_t ignored;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (do_dryrun) {
 | 
						if (do_dryrun) {
 | 
				
			||||||
		einfo("Would send %s to init", cmd);
 | 
							einfo("Would send %s to init", cmd);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -27,12 +27,18 @@
 | 
				
			|||||||
#include "rc-misc.h"
 | 
					#include "rc-misc.h"
 | 
				
			||||||
#include "_usage.h"
 | 
					#include "_usage.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					enum format_t {
 | 
				
			||||||
 | 
						FORMAT_DEFAULT,
 | 
				
			||||||
 | 
						FORMAT_INI,
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const char *applet = NULL;
 | 
					const char *applet = NULL;
 | 
				
			||||||
const char *extraopts = NULL;
 | 
					const char *extraopts = NULL;
 | 
				
			||||||
const char *getoptstring = "aclmrsSu" getoptstring_COMMON;
 | 
					const char *getoptstring = "acf:lmrsSu" getoptstring_COMMON;
 | 
				
			||||||
const struct option longopts[] = {
 | 
					const struct option longopts[] = {
 | 
				
			||||||
	{"all",         0, NULL, 'a'},
 | 
						{"all",         0, NULL, 'a'},
 | 
				
			||||||
	{"crashed",     0, NULL, 'c'},
 | 
						{"crashed",     0, NULL, 'c'},
 | 
				
			||||||
 | 
						{"format",     1, NULL, 'f'},
 | 
				
			||||||
	{"list",        0, NULL, 'l'},
 | 
						{"list",        0, NULL, 'l'},
 | 
				
			||||||
	{"manual",        0, NULL, 'm'},
 | 
						{"manual",        0, NULL, 'm'},
 | 
				
			||||||
	{"runlevel",    0, NULL, 'r'},
 | 
						{"runlevel",    0, NULL, 'r'},
 | 
				
			||||||
@@ -44,6 +50,7 @@ const struct option longopts[] = {
 | 
				
			|||||||
const char * const longopts_help[] = {
 | 
					const char * const longopts_help[] = {
 | 
				
			||||||
	"Show services from all run levels",
 | 
						"Show services from all run levels",
 | 
				
			||||||
	"Show crashed services",
 | 
						"Show crashed services",
 | 
				
			||||||
 | 
						"format status to be parsable (currently arg must be ini)",
 | 
				
			||||||
	"Show list of run levels",
 | 
						"Show list of run levels",
 | 
				
			||||||
	"Show manually started services",
 | 
						"Show manually started services",
 | 
				
			||||||
	"Show the name of the current runlevel",
 | 
						"Show the name of the current runlevel",
 | 
				
			||||||
@@ -53,7 +60,7 @@ const char * const longopts_help[] = {
 | 
				
			|||||||
	longopts_help_COMMON
 | 
						longopts_help_COMMON
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
const char *usagestring = ""						\
 | 
					const char *usagestring = ""						\
 | 
				
			||||||
	"Usage: rc-status [options] <runlevel>...\n"		\
 | 
						"Usage: rc-status [options] -f ini <runlevel>...\n"		\
 | 
				
			||||||
	"   or: rc-status [options] [-a | -c | -l | -m | -r | -s | -u]";
 | 
						"   or: rc-status [options] [-a | -c | -l | -m | -r | -s | -u]";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static RC_DEPTREE *deptree;
 | 
					static RC_DEPTREE *deptree;
 | 
				
			||||||
@@ -62,19 +69,27 @@ static RC_STRINGLIST *types;
 | 
				
			|||||||
static RC_STRINGLIST *levels, *services, *tmp, *alist;
 | 
					static RC_STRINGLIST *levels, *services, *tmp, *alist;
 | 
				
			||||||
static RC_STRINGLIST *sservices, *nservices, *needsme;
 | 
					static RC_STRINGLIST *sservices, *nservices, *needsme;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void
 | 
					static void print_level(const char *prefix, const char *level,
 | 
				
			||||||
print_level(const char *prefix, const char *level)
 | 
							enum format_t format)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	if (prefix)
 | 
						switch (format) {
 | 
				
			||||||
		printf("%s ", prefix);
 | 
						case FORMAT_DEFAULT:
 | 
				
			||||||
	printf ("Runlevel: ");
 | 
							if (prefix)
 | 
				
			||||||
	if (isatty(fileno(stdout)))
 | 
								printf("%s ", prefix);
 | 
				
			||||||
		printf("%s%s%s\n",
 | 
							printf ("Runlevel: ");
 | 
				
			||||||
		       ecolor(ECOLOR_HILITE),
 | 
							if (isatty(fileno(stdout)))
 | 
				
			||||||
		       level,
 | 
								printf("%s%s%s\n",
 | 
				
			||||||
		       ecolor(ECOLOR_NORMAL));
 | 
										ecolor(ECOLOR_HILITE), level, ecolor(ECOLOR_NORMAL));
 | 
				
			||||||
	else
 | 
							else
 | 
				
			||||||
		printf("%s\n", level);
 | 
								printf("%s\n", level);
 | 
				
			||||||
 | 
							break;
 | 
				
			||||||
 | 
						case FORMAT_INI:
 | 
				
			||||||
 | 
							printf("%s", "[");
 | 
				
			||||||
 | 
							if (prefix)
 | 
				
			||||||
 | 
								printf("%s ", prefix);
 | 
				
			||||||
 | 
							printf("%s]\n", level);
 | 
				
			||||||
 | 
							break;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static char *get_uptime(const char *service)
 | 
					static char *get_uptime(const char *service)
 | 
				
			||||||
@@ -125,14 +140,13 @@ static char *get_uptime(const char *service)
 | 
				
			|||||||
	return uptime;
 | 
						return uptime;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void
 | 
					static void print_service(const char *service, enum format_t format)
 | 
				
			||||||
print_service(const char *service)
 | 
					 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	char *status = NULL;
 | 
						char *status = NULL;
 | 
				
			||||||
	char *uptime = NULL;
 | 
						char *uptime = NULL;
 | 
				
			||||||
	char *child_pid = NULL;
 | 
						char *child_pid = NULL;
 | 
				
			||||||
	char *start_time = NULL;
 | 
						char *start_time = NULL;
 | 
				
			||||||
	int cols =  printf(" %s", service);
 | 
						int cols;
 | 
				
			||||||
	const char *c = ecolor(ECOLOR_GOOD);
 | 
						const char *c = ecolor(ECOLOR_GOOD);
 | 
				
			||||||
	RC_SERVICE state = rc_service_state(service);
 | 
						RC_SERVICE state = rc_service_state(service);
 | 
				
			||||||
	ECOLOR color = ECOLOR_BAD;
 | 
						ECOLOR color = ECOLOR_BAD;
 | 
				
			||||||
@@ -176,14 +190,22 @@ print_service(const char *service)
 | 
				
			|||||||
		xasprintf(&status, " stopped ");
 | 
							xasprintf(&status, " stopped ");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	errno = 0;
 | 
						errno = 0;
 | 
				
			||||||
	if (c && *c && isatty(fileno(stdout)))
 | 
						switch (format) {
 | 
				
			||||||
		printf("\n");
 | 
						case FORMAT_DEFAULT:
 | 
				
			||||||
	ebracket(cols, color, status);
 | 
							cols =  printf(" %s", service);
 | 
				
			||||||
 | 
							if (c && *c && isatty(fileno(stdout)))
 | 
				
			||||||
 | 
								printf("\n");
 | 
				
			||||||
 | 
							ebracket(cols, color, status);
 | 
				
			||||||
 | 
							break;
 | 
				
			||||||
 | 
						case FORMAT_INI:
 | 
				
			||||||
 | 
							printf("%s = %s\n", service, status);
 | 
				
			||||||
 | 
							break;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
	free(status);
 | 
						free(status);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void
 | 
					static void print_services(const char *runlevel, RC_STRINGLIST *svcs,
 | 
				
			||||||
print_services(const char *runlevel, RC_STRINGLIST *svcs)
 | 
							enum format_t format)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	RC_STRINGLIST *l = NULL;
 | 
						RC_STRINGLIST *l = NULL;
 | 
				
			||||||
	RC_STRING *s;
 | 
						RC_STRING *s;
 | 
				
			||||||
@@ -197,7 +219,7 @@ print_services(const char *runlevel, RC_STRINGLIST *svcs)
 | 
				
			|||||||
		TAILQ_FOREACH(s, svcs, entries)
 | 
							TAILQ_FOREACH(s, svcs, entries)
 | 
				
			||||||
			if (!runlevel ||
 | 
								if (!runlevel ||
 | 
				
			||||||
			    rc_service_in_runlevel(s->value, runlevel))
 | 
								    rc_service_in_runlevel(s->value, runlevel))
 | 
				
			||||||
				print_service(s->value);
 | 
									print_service(s->value, format);
 | 
				
			||||||
		return;
 | 
							return;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	if (!types) {
 | 
						if (!types) {
 | 
				
			||||||
@@ -217,13 +239,12 @@ print_services(const char *runlevel, RC_STRINGLIST *svcs)
 | 
				
			|||||||
		if (!rc_stringlist_find(svcs, s->value))
 | 
							if (!rc_stringlist_find(svcs, s->value))
 | 
				
			||||||
			continue;
 | 
								continue;
 | 
				
			||||||
		if (!runlevel || rc_service_in_runlevel(s->value, runlevel))
 | 
							if (!runlevel || rc_service_in_runlevel(s->value, runlevel))
 | 
				
			||||||
			print_service(s->value);
 | 
								print_service(s->value, format);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	rc_stringlist_free(l);
 | 
						rc_stringlist_free(l);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void
 | 
					static void print_stacked_services(const char *runlevel, enum format_t format)
 | 
				
			||||||
print_stacked_services(const char *runlevel)
 | 
					 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	RC_STRINGLIST *stackedlevels, *servicelist;
 | 
						RC_STRINGLIST *stackedlevels, *servicelist;
 | 
				
			||||||
	RC_STRING *stackedlevel;
 | 
						RC_STRING *stackedlevel;
 | 
				
			||||||
@@ -232,9 +253,9 @@ print_stacked_services(const char *runlevel)
 | 
				
			|||||||
	TAILQ_FOREACH(stackedlevel, stackedlevels, entries) {
 | 
						TAILQ_FOREACH(stackedlevel, stackedlevels, entries) {
 | 
				
			||||||
		if (rc_stringlist_find(levels, stackedlevel->value) != NULL)
 | 
							if (rc_stringlist_find(levels, stackedlevel->value) != NULL)
 | 
				
			||||||
			continue;
 | 
								continue;
 | 
				
			||||||
		print_level("Stacked", stackedlevel->value);
 | 
							print_level("Stacked", stackedlevel->value, format);
 | 
				
			||||||
		servicelist = rc_services_in_runlevel(stackedlevel->value);
 | 
							servicelist = rc_services_in_runlevel(stackedlevel->value);
 | 
				
			||||||
		print_services(stackedlevel->value, servicelist);
 | 
							print_services(stackedlevel->value, servicelist, format);
 | 
				
			||||||
		rc_stringlist_free(servicelist);
 | 
							rc_stringlist_free(servicelist);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	rc_stringlist_free(stackedlevels);
 | 
						rc_stringlist_free(stackedlevels);
 | 
				
			||||||
@@ -244,7 +265,9 @@ print_stacked_services(const char *runlevel)
 | 
				
			|||||||
int main(int argc, char **argv)
 | 
					int main(int argc, char **argv)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	RC_SERVICE state;
 | 
						RC_SERVICE state;
 | 
				
			||||||
    RC_STRING *s, *l, *t, *level;
 | 
						RC_STRING *s, *l, *t, *level;
 | 
				
			||||||
 | 
						enum format_t format = FORMAT_DEFAULT;
 | 
				
			||||||
 | 
						bool levels_given = false;
 | 
				
			||||||
	bool show_all = false;
 | 
						bool show_all = false;
 | 
				
			||||||
	char *p, *runlevel = NULL;
 | 
						char *p, *runlevel = NULL;
 | 
				
			||||||
	int opt, retval = 0;
 | 
						int opt, retval = 0;
 | 
				
			||||||
@@ -267,6 +290,12 @@ int main(int argc, char **argv)
 | 
				
			|||||||
				}
 | 
									}
 | 
				
			||||||
			goto exit;
 | 
								goto exit;
 | 
				
			||||||
			/* NOTREACHED */
 | 
								/* NOTREACHED */
 | 
				
			||||||
 | 
							case 'f':
 | 
				
			||||||
 | 
								if (strcasecmp(optarg, "ini") == 0)
 | 
				
			||||||
 | 
									format = FORMAT_INI;
 | 
				
			||||||
 | 
								else
 | 
				
			||||||
 | 
									eerrorx("%s: invalid argument to --format switch\n", applet);
 | 
				
			||||||
 | 
								break;
 | 
				
			||||||
		case 'l':
 | 
							case 'l':
 | 
				
			||||||
			levels = rc_runlevel_list();
 | 
								levels = rc_runlevel_list();
 | 
				
			||||||
			TAILQ_FOREACH(l, levels, entries)
 | 
								TAILQ_FOREACH(l, levels, entries)
 | 
				
			||||||
@@ -291,7 +320,7 @@ int main(int argc, char **argv)
 | 
				
			|||||||
					free(s->value);
 | 
										free(s->value);
 | 
				
			||||||
					free(s);
 | 
										free(s);
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
			print_services(NULL, services);
 | 
								print_services(NULL, services, FORMAT_DEFAULT);
 | 
				
			||||||
			goto exit;
 | 
								goto exit;
 | 
				
			||||||
		case 'r':
 | 
							case 'r':
 | 
				
			||||||
			runlevel = rc_runlevel_get();
 | 
								runlevel = rc_runlevel_get();
 | 
				
			||||||
@@ -303,12 +332,12 @@ int main(int argc, char **argv)
 | 
				
			|||||||
			TAILQ_FOREACH_SAFE(s, services, entries, t)
 | 
								TAILQ_FOREACH_SAFE(s, services, entries, t)
 | 
				
			||||||
				if (!rc_service_value_get(s->value, "child_pid"))
 | 
									if (!rc_service_value_get(s->value, "child_pid"))
 | 
				
			||||||
					TAILQ_REMOVE(services, s, entries);
 | 
										TAILQ_REMOVE(services, s, entries);
 | 
				
			||||||
			print_services(NULL, services);
 | 
								print_services(NULL, services, FORMAT_DEFAULT);
 | 
				
			||||||
			goto exit;
 | 
								goto exit;
 | 
				
			||||||
			/* NOTREACHED */
 | 
								/* NOTREACHED */
 | 
				
			||||||
		case 's':
 | 
							case 's':
 | 
				
			||||||
			services = rc_services_in_runlevel(NULL);
 | 
								services = rc_services_in_runlevel(NULL);
 | 
				
			||||||
			print_services(NULL, services);
 | 
								print_services(NULL, services, FORMAT_DEFAULT);
 | 
				
			||||||
			goto exit;
 | 
								goto exit;
 | 
				
			||||||
			/* NOTREACHED */
 | 
								/* NOTREACHED */
 | 
				
			||||||
		case 'u':
 | 
							case 'u':
 | 
				
			||||||
@@ -323,7 +352,7 @@ int main(int argc, char **argv)
 | 
				
			|||||||
						break;
 | 
											break;
 | 
				
			||||||
					}
 | 
										}
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
			print_services(NULL, services);
 | 
								print_services(NULL, services, FORMAT_DEFAULT);
 | 
				
			||||||
			goto exit;
 | 
								goto exit;
 | 
				
			||||||
			/* NOTREACHED */
 | 
								/* NOTREACHED */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -335,6 +364,7 @@ int main(int argc, char **argv)
 | 
				
			|||||||
	opt = (optind < argc) ? 0 : 1;
 | 
						opt = (optind < argc) ? 0 : 1;
 | 
				
			||||||
	while (optind < argc) {
 | 
						while (optind < argc) {
 | 
				
			||||||
		if (rc_runlevel_exists(argv[optind])) {
 | 
							if (rc_runlevel_exists(argv[optind])) {
 | 
				
			||||||
 | 
								levels_given = true;
 | 
				
			||||||
			rc_stringlist_add(levels, argv[optind++]);
 | 
								rc_stringlist_add(levels, argv[optind++]);
 | 
				
			||||||
			opt++;
 | 
								opt++;
 | 
				
			||||||
		} else
 | 
							} else
 | 
				
			||||||
@@ -351,21 +381,21 @@ int main(int argc, char **argv)
 | 
				
			|||||||
	deptree = _rc_deptree_load(0, NULL);
 | 
						deptree = _rc_deptree_load(0, NULL);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	TAILQ_FOREACH(l, levels, entries) {
 | 
						TAILQ_FOREACH(l, levels, entries) {
 | 
				
			||||||
		print_level(NULL, l->value);
 | 
							print_level(NULL, l->value, format);
 | 
				
			||||||
		services = rc_services_in_runlevel(l->value);
 | 
							services = rc_services_in_runlevel(l->value);
 | 
				
			||||||
		print_services(l->value, services);
 | 
							print_services(l->value, services, format);
 | 
				
			||||||
		print_stacked_services(l->value);
 | 
							print_stacked_services(l->value, format);
 | 
				
			||||||
		rc_stringlist_free(nservices);
 | 
							rc_stringlist_free(nservices);
 | 
				
			||||||
		nservices = NULL;
 | 
							nservices = NULL;
 | 
				
			||||||
		rc_stringlist_free(services);
 | 
							rc_stringlist_free(services);
 | 
				
			||||||
		services = NULL;
 | 
							services = NULL;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (show_all || argc < 2) {
 | 
						if (show_all || !levels_given) {
 | 
				
			||||||
		/* Show hotplugged services */
 | 
							/* Show hotplugged services */
 | 
				
			||||||
		print_level("Dynamic", "hotplugged");
 | 
							print_level("Dynamic", "hotplugged", format);
 | 
				
			||||||
		services = rc_services_in_state(RC_SERVICE_HOTPLUGGED);
 | 
							services = rc_services_in_state(RC_SERVICE_HOTPLUGGED);
 | 
				
			||||||
		print_services(NULL, services);
 | 
							print_services(NULL, services, format);
 | 
				
			||||||
		rc_stringlist_free(services);
 | 
							rc_stringlist_free(services);
 | 
				
			||||||
		services = NULL;
 | 
							services = NULL;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -422,10 +452,10 @@ int main(int argc, char **argv)
 | 
				
			|||||||
		 * be added to the list
 | 
							 * be added to the list
 | 
				
			||||||
		 */
 | 
							 */
 | 
				
			||||||
		unsetenv("RC_SVCNAME");
 | 
							unsetenv("RC_SVCNAME");
 | 
				
			||||||
		print_level("Dynamic", "needed/wanted");
 | 
							print_level("Dynamic", "needed/wanted", format);
 | 
				
			||||||
		print_services(NULL, nservices);
 | 
							print_services(NULL, nservices, format);
 | 
				
			||||||
		print_level("Dynamic", "manual");
 | 
							print_level("Dynamic", "manual", format);
 | 
				
			||||||
		print_services(NULL, services);
 | 
							print_services(NULL, services, format);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
exit:
 | 
					exit:
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -43,8 +43,8 @@ void log_wtmp(const char *user, const char *id, pid_t pid, int type,
 | 
				
			|||||||
	strncpy(utmp.ut_id  , id  , sizeof(utmp.ut_id  ));
 | 
						strncpy(utmp.ut_id  , id  , sizeof(utmp.ut_id  ));
 | 
				
			||||||
	strncpy(utmp.ut_line, line, sizeof(utmp.ut_line));
 | 
						strncpy(utmp.ut_line, line, sizeof(utmp.ut_line));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        /* Put the OS version in place of the hostname */
 | 
						/* Put the OS version in place of the hostname */
 | 
				
			||||||
        if (uname(&uname_buf) == 0)
 | 
						if (uname(&uname_buf) == 0)
 | 
				
			||||||
		strncpy(utmp.ut_host, uname_buf.release, sizeof(utmp.ut_host));
 | 
							strncpy(utmp.ut_host, uname_buf.release, sizeof(utmp.ut_host));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	updwtmp(WTMP_FILE, &utmp);
 | 
						updwtmp(WTMP_FILE, &utmp);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -492,7 +492,7 @@ int main(int argc, char **argv)
 | 
				
			|||||||
			startas = optarg;
 | 
								startas = optarg;
 | 
				
			||||||
			break;
 | 
								break;
 | 
				
			||||||
		case 'w':
 | 
							case 'w':
 | 
				
			||||||
			if (sscanf(optarg, "%d", &start_wait) != 1)
 | 
								if (sscanf(optarg, "%u", &start_wait) != 1)
 | 
				
			||||||
				eerrorx("%s: `%s' not a number",
 | 
									eerrorx("%s: `%s' not a number",
 | 
				
			||||||
				    applet, optarg);
 | 
									    applet, optarg);
 | 
				
			||||||
			break;
 | 
								break;
 | 
				
			||||||
@@ -547,7 +547,7 @@ int main(int argc, char **argv)
 | 
				
			|||||||
	} else if (name) {
 | 
						} else if (name) {
 | 
				
			||||||
		*--argv = name;
 | 
							*--argv = name;
 | 
				
			||||||
		++argc;
 | 
							++argc;
 | 
				
			||||||
    } else if (exec) {
 | 
						} else if (exec) {
 | 
				
			||||||
		*--argv = exec;
 | 
							*--argv = exec;
 | 
				
			||||||
		++argc;
 | 
							++argc;
 | 
				
			||||||
	};
 | 
						};
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -237,7 +237,7 @@ static char * expand_home(const char *home, const char *path)
 | 
				
			|||||||
		ppath++;
 | 
							ppath++;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (!home) {
 | 
						if (!home) {
 | 
				
			||||||
	free(opath);
 | 
							free(opath);
 | 
				
			||||||
		return xstrdup(path);
 | 
							return xstrdup(path);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	if (!ppath) {
 | 
						if (!ppath) {
 | 
				
			||||||
@@ -535,7 +535,7 @@ static void supervisor(char *exec, char **argv)
 | 
				
			|||||||
	sigaction(SIGTERM, &sa, NULL);
 | 
						sigaction(SIGTERM, &sa, NULL);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	fp = fopen(pidfile, "w");
 | 
						fp = fopen(pidfile, "w");
 | 
				
			||||||
	if (! fp)
 | 
						if (!fp)
 | 
				
			||||||
		eerrorx("%s: fopen `%s': %s", applet, pidfile, strerror(errno));
 | 
							eerrorx("%s: fopen `%s': %s", applet, pidfile, strerror(errno));
 | 
				
			||||||
	fprintf(fp, "%d\n", getpid());
 | 
						fprintf(fp, "%d\n", getpid());
 | 
				
			||||||
	fclose(fp);
 | 
						fclose(fp);
 | 
				
			||||||
@@ -557,10 +557,10 @@ static void supervisor(char *exec, char **argv)
 | 
				
			|||||||
		alarm(healthcheckdelay);
 | 
							alarm(healthcheckdelay);
 | 
				
			||||||
	else if (healthchecktimer)
 | 
						else if (healthchecktimer)
 | 
				
			||||||
		alarm(healthchecktimer);
 | 
							alarm(healthchecktimer);
 | 
				
			||||||
 failing = 0;
 | 
						failing = 0;
 | 
				
			||||||
	while (!exiting) {
 | 
						while (!exiting) {
 | 
				
			||||||
		healthcheck_respawn = 0;
 | 
							healthcheck_respawn = 0;
 | 
				
			||||||
 	fifo_fd = open(fifopath, O_RDONLY);
 | 
							fifo_fd = open(fifopath, O_RDONLY);
 | 
				
			||||||
		if (fifo_fd > 0) {
 | 
							if (fifo_fd > 0) {
 | 
				
			||||||
			memset(buf, 0, sizeof(buf));
 | 
								memset(buf, 0, sizeof(buf));
 | 
				
			||||||
			count = read(fifo_fd, buf, sizeof(buf) - 1);
 | 
								count = read(fifo_fd, buf, sizeof(buf) - 1);
 | 
				
			||||||
@@ -604,7 +604,7 @@ static void supervisor(char *exec, char **argv)
 | 
				
			|||||||
					healthcheck_respawn = 1;
 | 
										healthcheck_respawn = 1;
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		if (exiting ) {
 | 
							if (exiting) {
 | 
				
			||||||
			alarm(0);
 | 
								alarm(0);
 | 
				
			||||||
			syslog(LOG_INFO, "stopping %s, pid %d", exec, child_pid);
 | 
								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, NULL, NULL, child_pid, 0,
 | 
				
			||||||
@@ -720,7 +720,7 @@ int main(int argc, char **argv)
 | 
				
			|||||||
		eerrorx("%s: The RC_SVCNAME environment variable is not set", applet);
 | 
							eerrorx("%s: The RC_SVCNAME environment variable is not set", applet);
 | 
				
			||||||
	openlog(applet, LOG_PID, LOG_DAEMON);
 | 
						openlog(applet, LOG_PID, LOG_DAEMON);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (argc >= 1 && svcname && strcmp(argv[1], svcname))
 | 
						if (argc <= 1 || strcmp(argv[1], svcname))
 | 
				
			||||||
		eerrorx("%s: the first argument is %s and must be %s",
 | 
							eerrorx("%s: the first argument is %s and must be %s",
 | 
				
			||||||
				applet, argv[1], svcname);
 | 
									applet, argv[1], svcname);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -1062,8 +1062,8 @@ int main(int argc, char **argv)
 | 
				
			|||||||
				c++;
 | 
									c++;
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
			xasprintf(&varbuf, "%d", x);
 | 
								xasprintf(&varbuf, "%d", x);
 | 
				
			||||||
				rc_service_value_set(svcname, "argc", varbuf);
 | 
								rc_service_value_set(svcname, "argc", varbuf);
 | 
				
			||||||
				free(varbuf);
 | 
								free(varbuf);
 | 
				
			||||||
			rc_service_value_set(svcname, "exec", exec);
 | 
								rc_service_value_set(svcname, "exec", exec);
 | 
				
			||||||
			supervisor(exec, argv);
 | 
								supervisor(exec, argv);
 | 
				
			||||||
		} else
 | 
							} else
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										6
									
								
								src/test/.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										6
									
								
								src/test/.gitignore
									
									
									
									
										vendored
									
									
								
							@@ -1,6 +0,0 @@
 | 
				
			|||||||
einfo.data.out
 | 
					 | 
				
			||||||
einfo.funcs.out
 | 
					 | 
				
			||||||
librc.funcs.hidden.out
 | 
					 | 
				
			||||||
librc.funcs.hidden.list
 | 
					 | 
				
			||||||
rc.data.out
 | 
					 | 
				
			||||||
rc.funcs.out
 | 
					 | 
				
			||||||
@@ -1 +0,0 @@
 | 
				
			|||||||
EINFO_1.0
 | 
					 | 
				
			||||||
@@ -1,52 +0,0 @@
 | 
				
			|||||||
ebegin
 | 
					 | 
				
			||||||
ebegin@@EINFO_1.0
 | 
					 | 
				
			||||||
ebeginv
 | 
					 | 
				
			||||||
ebeginv@@EINFO_1.0
 | 
					 | 
				
			||||||
ebracket
 | 
					 | 
				
			||||||
ebracket@@EINFO_1.0
 | 
					 | 
				
			||||||
ecolor
 | 
					 | 
				
			||||||
ecolor@@EINFO_1.0
 | 
					 | 
				
			||||||
eend
 | 
					 | 
				
			||||||
eend@@EINFO_1.0
 | 
					 | 
				
			||||||
eendv
 | 
					 | 
				
			||||||
eendv@@EINFO_1.0
 | 
					 | 
				
			||||||
eerror
 | 
					 | 
				
			||||||
eerror@@EINFO_1.0
 | 
					 | 
				
			||||||
eerrorn
 | 
					 | 
				
			||||||
eerrorn@@EINFO_1.0
 | 
					 | 
				
			||||||
eerrorx
 | 
					 | 
				
			||||||
eerrorx@@EINFO_1.0
 | 
					 | 
				
			||||||
eindent
 | 
					 | 
				
			||||||
eindent@@EINFO_1.0
 | 
					 | 
				
			||||||
eindentv
 | 
					 | 
				
			||||||
eindentv@@EINFO_1.0
 | 
					 | 
				
			||||||
einfo
 | 
					 | 
				
			||||||
einfo@@EINFO_1.0
 | 
					 | 
				
			||||||
einfon
 | 
					 | 
				
			||||||
einfon@@EINFO_1.0
 | 
					 | 
				
			||||||
einfov
 | 
					 | 
				
			||||||
einfov@@EINFO_1.0
 | 
					 | 
				
			||||||
einfovn
 | 
					 | 
				
			||||||
einfovn@@EINFO_1.0
 | 
					 | 
				
			||||||
elog
 | 
					 | 
				
			||||||
elog@@EINFO_1.0
 | 
					 | 
				
			||||||
eoutdent
 | 
					 | 
				
			||||||
eoutdent@@EINFO_1.0
 | 
					 | 
				
			||||||
eoutdentv
 | 
					 | 
				
			||||||
eoutdentv@@EINFO_1.0
 | 
					 | 
				
			||||||
eprefix
 | 
					 | 
				
			||||||
eprefix@@EINFO_1.0
 | 
					 | 
				
			||||||
ewarn
 | 
					 | 
				
			||||||
ewarn@@EINFO_1.0
 | 
					 | 
				
			||||||
ewarnn
 | 
					 | 
				
			||||||
ewarnn@@EINFO_1.0
 | 
					 | 
				
			||||||
ewarnv
 | 
					 | 
				
			||||||
ewarnv@@EINFO_1.0
 | 
					 | 
				
			||||||
ewarnvn
 | 
					 | 
				
			||||||
ewarnvn@@EINFO_1.0
 | 
					 | 
				
			||||||
ewarnx
 | 
					 | 
				
			||||||
ewarnx@@EINFO_1.0
 | 
					 | 
				
			||||||
ewend
 | 
					 | 
				
			||||||
ewend@@EINFO_1.0
 | 
					 | 
				
			||||||
ewendv
 | 
					 | 
				
			||||||
ewendv@@EINFO_1.0
 | 
					 | 
				
			||||||
@@ -1,3 +0,0 @@
 | 
				
			|||||||
RC_1.0
 | 
					 | 
				
			||||||
rc_environ_fd
 | 
					 | 
				
			||||||
rc_environ_fd@@RC_1.0
 | 
					 | 
				
			||||||
@@ -1,116 +0,0 @@
 | 
				
			|||||||
rc_conf_value
 | 
					 | 
				
			||||||
rc_conf_value@@RC_1.0
 | 
					 | 
				
			||||||
rc_config_list
 | 
					 | 
				
			||||||
rc_config_list@@RC_1.0
 | 
					 | 
				
			||||||
rc_config_load
 | 
					 | 
				
			||||||
rc_config_load@@RC_1.0
 | 
					 | 
				
			||||||
rc_config_value
 | 
					 | 
				
			||||||
rc_config_value@@RC_1.0
 | 
					 | 
				
			||||||
rc_deptree_depend
 | 
					 | 
				
			||||||
rc_deptree_depend@@RC_1.0
 | 
					 | 
				
			||||||
rc_deptree_depends
 | 
					 | 
				
			||||||
rc_deptree_depends@@RC_1.0
 | 
					 | 
				
			||||||
rc_deptree_free
 | 
					 | 
				
			||||||
rc_deptree_free@@RC_1.0
 | 
					 | 
				
			||||||
rc_deptree_load
 | 
					 | 
				
			||||||
rc_deptree_load@@RC_1.0
 | 
					 | 
				
			||||||
rc_deptree_load_file
 | 
					 | 
				
			||||||
rc_deptree_load_file@@RC_1.0
 | 
					 | 
				
			||||||
rc_deptree_order
 | 
					 | 
				
			||||||
rc_deptree_order@@RC_1.0
 | 
					 | 
				
			||||||
rc_deptree_update
 | 
					 | 
				
			||||||
rc_deptree_update@@RC_1.0
 | 
					 | 
				
			||||||
rc_deptree_update_needed
 | 
					 | 
				
			||||||
rc_deptree_update_needed@@RC_1.0
 | 
					 | 
				
			||||||
rc_find_pids
 | 
					 | 
				
			||||||
rc_find_pids@@RC_1.0
 | 
					 | 
				
			||||||
rc_getfile
 | 
					 | 
				
			||||||
rc_getfile@@RC_1.0
 | 
					 | 
				
			||||||
rc_getline
 | 
					 | 
				
			||||||
rc_getline@@RC_1.0
 | 
					 | 
				
			||||||
rc_newer_than
 | 
					 | 
				
			||||||
rc_newer_than@@RC_1.0
 | 
					 | 
				
			||||||
rc_older_than
 | 
					 | 
				
			||||||
rc_older_than@@RC_1.0
 | 
					 | 
				
			||||||
rc_proc_getent
 | 
					 | 
				
			||||||
rc_proc_getent@@RC_1.0
 | 
					 | 
				
			||||||
rc_runlevel_exists
 | 
					 | 
				
			||||||
rc_runlevel_exists@@RC_1.0
 | 
					 | 
				
			||||||
rc_runlevel_get
 | 
					 | 
				
			||||||
rc_runlevel_get@@RC_1.0
 | 
					 | 
				
			||||||
rc_runlevel_list
 | 
					 | 
				
			||||||
rc_runlevel_list@@RC_1.0
 | 
					 | 
				
			||||||
rc_runlevel_set
 | 
					 | 
				
			||||||
rc_runlevel_set@@RC_1.0
 | 
					 | 
				
			||||||
rc_runlevel_stack
 | 
					 | 
				
			||||||
rc_runlevel_stack@@RC_1.0
 | 
					 | 
				
			||||||
rc_runlevel_stacks
 | 
					 | 
				
			||||||
rc_runlevel_stacks@@RC_1.0
 | 
					 | 
				
			||||||
rc_runlevel_starting
 | 
					 | 
				
			||||||
rc_runlevel_starting@@RC_1.0
 | 
					 | 
				
			||||||
rc_runlevel_stopping
 | 
					 | 
				
			||||||
rc_runlevel_stopping@@RC_1.0
 | 
					 | 
				
			||||||
rc_runlevel_unstack
 | 
					 | 
				
			||||||
rc_runlevel_unstack@@RC_1.0
 | 
					 | 
				
			||||||
rc_service_add
 | 
					 | 
				
			||||||
rc_service_add@@RC_1.0
 | 
					 | 
				
			||||||
rc_service_daemon_set
 | 
					 | 
				
			||||||
rc_service_daemon_set@@RC_1.0
 | 
					 | 
				
			||||||
rc_service_daemons_crashed
 | 
					 | 
				
			||||||
rc_service_daemons_crashed@@RC_1.0
 | 
					 | 
				
			||||||
rc_service_delete
 | 
					 | 
				
			||||||
rc_service_delete@@RC_1.0
 | 
					 | 
				
			||||||
rc_service_description
 | 
					 | 
				
			||||||
rc_service_description@@RC_1.0
 | 
					 | 
				
			||||||
rc_service_exists
 | 
					 | 
				
			||||||
rc_service_exists@@RC_1.0
 | 
					 | 
				
			||||||
rc_service_extra_commands
 | 
					 | 
				
			||||||
rc_service_extra_commands@@RC_1.0
 | 
					 | 
				
			||||||
rc_service_in_runlevel
 | 
					 | 
				
			||||||
rc_service_in_runlevel@@RC_1.0
 | 
					 | 
				
			||||||
rc_service_mark
 | 
					 | 
				
			||||||
rc_service_mark@@RC_1.0
 | 
					 | 
				
			||||||
rc_service_resolve
 | 
					 | 
				
			||||||
rc_service_resolve@@RC_1.0
 | 
					 | 
				
			||||||
rc_service_schedule_clear
 | 
					 | 
				
			||||||
rc_service_schedule_clear@@RC_1.0
 | 
					 | 
				
			||||||
rc_service_schedule_start
 | 
					 | 
				
			||||||
rc_service_schedule_start@@RC_1.0
 | 
					 | 
				
			||||||
rc_service_started_daemon
 | 
					 | 
				
			||||||
rc_service_started_daemon@@RC_1.0
 | 
					 | 
				
			||||||
rc_service_state
 | 
					 | 
				
			||||||
rc_service_state@@RC_1.0
 | 
					 | 
				
			||||||
rc_service_value_get
 | 
					 | 
				
			||||||
rc_service_value_get@@RC_1.0
 | 
					 | 
				
			||||||
rc_service_value_set
 | 
					 | 
				
			||||||
rc_service_value_set@@RC_1.0
 | 
					 | 
				
			||||||
rc_services_in_runlevel
 | 
					 | 
				
			||||||
rc_services_in_runlevel@@RC_1.0
 | 
					 | 
				
			||||||
rc_services_in_runlevel_stacked
 | 
					 | 
				
			||||||
rc_services_in_runlevel_stacked@@RC_1.0
 | 
					 | 
				
			||||||
rc_services_in_state
 | 
					 | 
				
			||||||
rc_services_in_state@@RC_1.0
 | 
					 | 
				
			||||||
rc_services_scheduled
 | 
					 | 
				
			||||||
rc_services_scheduled@@RC_1.0
 | 
					 | 
				
			||||||
rc_services_scheduled_by
 | 
					 | 
				
			||||||
rc_services_scheduled_by@@RC_1.0
 | 
					 | 
				
			||||||
rc_stringlist_add
 | 
					 | 
				
			||||||
rc_stringlist_add@@RC_1.0
 | 
					 | 
				
			||||||
rc_stringlist_addu
 | 
					 | 
				
			||||||
rc_stringlist_addu@@RC_1.0
 | 
					 | 
				
			||||||
rc_stringlist_delete
 | 
					 | 
				
			||||||
rc_stringlist_delete@@RC_1.0
 | 
					 | 
				
			||||||
rc_stringlist_find
 | 
					 | 
				
			||||||
rc_stringlist_find@@RC_1.0
 | 
					 | 
				
			||||||
rc_stringlist_free
 | 
					 | 
				
			||||||
rc_stringlist_free@@RC_1.0
 | 
					 | 
				
			||||||
rc_stringlist_new
 | 
					 | 
				
			||||||
rc_stringlist_new@@RC_1.0
 | 
					 | 
				
			||||||
rc_stringlist_sort
 | 
					 | 
				
			||||||
rc_stringlist_sort@@RC_1.0
 | 
					 | 
				
			||||||
rc_stringlist_split
 | 
					 | 
				
			||||||
rc_stringlist_split@@RC_1.0
 | 
					 | 
				
			||||||
rc_sys
 | 
					 | 
				
			||||||
rc_sys@@RC_1.0
 | 
					 | 
				
			||||||
rc_yesno
 | 
					 | 
				
			||||||
rc_yesno@@RC_1.0
 | 
					 | 
				
			||||||
@@ -1,6 +1,6 @@
 | 
				
			|||||||
#!/bin/sh
 | 
					#!/bin/sh
 | 
				
			||||||
 | 
					
 | 
				
			||||||
top_srcdir=${top_srcdir:-../..}
 | 
					top_srcdir=${top_srcdir:-..}
 | 
				
			||||||
. ${top_srcdir}/test/setup_env.sh
 | 
					. ${top_srcdir}/test/setup_env.sh
 | 
				
			||||||
 | 
					
 | 
				
			||||||
libeinfo_srcdir="${srcdir}/../libeinfo"
 | 
					libeinfo_srcdir="${srcdir}/../libeinfo"
 | 
				
			||||||
@@ -27,53 +27,6 @@ fail_on_out() {
 | 
				
			|||||||
	fi
 | 
						fi
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
ebegin "Checking exported symbols in libeinfo.so (data)"
 | 
					 | 
				
			||||||
checkit einfo.data $(
 | 
					 | 
				
			||||||
readelf -Ws ${libeinfo_builddir}/libeinfo.so \
 | 
					 | 
				
			||||||
	| awk '$4 == "OBJECT" && $5 == "GLOBAL" && $7 != "UND" {print $NF}' \
 | 
					 | 
				
			||||||
	| LC_ALL=C sort -u
 | 
					 | 
				
			||||||
)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
ebegin "Checking exported symbols in libeinfo.so (functions)"
 | 
					 | 
				
			||||||
checkit einfo.funcs $(
 | 
					 | 
				
			||||||
readelf -Ws ${libeinfo_builddir}/libeinfo.so \
 | 
					 | 
				
			||||||
	| awk '$4 == "FUNC" && $5 == "GLOBAL" && $7 != "UND" {print $NF}' \
 | 
					 | 
				
			||||||
	| LC_ALL=C sort -u \
 | 
					 | 
				
			||||||
	| egrep -v \
 | 
					 | 
				
			||||||
		-e '^_(init|fini)$'
 | 
					 | 
				
			||||||
)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
ebegin "Checking exported symbols in librc.so (data)"
 | 
					 | 
				
			||||||
checkit rc.data $(
 | 
					 | 
				
			||||||
readelf -Ws ${librc_builddir}/librc.so \
 | 
					 | 
				
			||||||
	| awk '$4 == "OBJECT" && $5 == "GLOBAL" && $7 != "UND" {print $NF}' \
 | 
					 | 
				
			||||||
	| LC_ALL=C sort -u
 | 
					 | 
				
			||||||
)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
ebegin "Checking exported symbols in librc.so (functions)"
 | 
					 | 
				
			||||||
checkit rc.funcs $(
 | 
					 | 
				
			||||||
readelf -Ws ${librc_builddir}/librc.so \
 | 
					 | 
				
			||||||
	| awk '$4 == "FUNC" && $5 == "GLOBAL" && $7 != "UND" {print $NF}' \
 | 
					 | 
				
			||||||
	| LC_ALL=C sort -u \
 | 
					 | 
				
			||||||
	| egrep -v \
 | 
					 | 
				
			||||||
		-e '^_(init|fini)$'
 | 
					 | 
				
			||||||
)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
ebegin "Checking hidden functions in librc.so"
 | 
					 | 
				
			||||||
sed -n '/^librc_hidden_proto/s:.*(\(.*\))$:\1:p' ${librc_srcdir}/librc.h \
 | 
					 | 
				
			||||||
	| LC_ALL=C sort -u \
 | 
					 | 
				
			||||||
	> librc.funcs.hidden.list
 | 
					 | 
				
			||||||
readelf -Wr $(grep -l '#include[[:space:]]"librc\.h"' ${librc_srcdir}/*.c | sed 's:\.c$:.o:') \
 | 
					 | 
				
			||||||
	| egrep -v -e 'R_PARISC_(DP|SEG)REL' \
 | 
					 | 
				
			||||||
	| awk '$5 ~ /^rc_/ {print $5}' \
 | 
					 | 
				
			||||||
	| LC_ALL=C sort -u \
 | 
					 | 
				
			||||||
	| egrep -v '^rc_environ_fd$' \
 | 
					 | 
				
			||||||
	> librc.funcs.hidden.out
 | 
					 | 
				
			||||||
syms=$(diff -u librc.funcs.hidden.list librc.funcs.hidden.out | sed -n '/^+[^+]/s:^+::p')
 | 
					 | 
				
			||||||
[ -z "${syms}" ]
 | 
					 | 
				
			||||||
eend $? "Missing hidden defs:"$'\n'"${syms}"
 | 
					 | 
				
			||||||
: $(( ret += $? ))
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
ebegin "Checking trailing whitespace in code"
 | 
					ebegin "Checking trailing whitespace in code"
 | 
				
			||||||
# XXX: Should we check man pages too ?
 | 
					# XXX: Should we check man pages too ?
 | 
				
			||||||
out=$(cd ${top_srcdir}; find */ \
 | 
					out=$(cd ${top_srcdir}; find */ \
 | 
				
			||||||
@@ -1,5 +0,0 @@
 | 
				
			|||||||
#!/bin/sh
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# top_srcdir=${top_srcdir:-SET/THIS/PATH/OK!?}
 | 
					 | 
				
			||||||
. ${top_srcdir}/test/setup_env.sh
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
@@ -15,7 +15,6 @@
 | 
				
			|||||||
ret=0
 | 
					ret=0
 | 
				
			||||||
 | 
					
 | 
				
			||||||
tret=0
 | 
					tret=0
 | 
				
			||||||
ebegin "Testing yesno()"
 | 
					 | 
				
			||||||
for f in yes YES Yes true TRUE True 1 ; do
 | 
					for f in yes YES Yes true TRUE True 1 ; do
 | 
				
			||||||
	if ! yesno $f; then
 | 
						if ! yesno $f; then
 | 
				
			||||||
		: $(( tret += 1 ))
 | 
							: $(( tret += 1 ))
 | 
				
			||||||
@@ -28,7 +27,7 @@ for f in no NO No false FALSE False 0 ; do
 | 
				
			|||||||
		echo "!$f!"
 | 
							echo "!$f!"
 | 
				
			||||||
	fi
 | 
						fi
 | 
				
			||||||
done
 | 
					done
 | 
				
			||||||
eend $tret
 | 
					 | 
				
			||||||
: $(( ret += $tret ))
 | 
					: $(( ret += $tret ))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					eend $ret
 | 
				
			||||||
exit $ret
 | 
					exit $ret
 | 
				
			||||||
@@ -1,27 +1,37 @@
 | 
				
			|||||||
#compdef rc-service
 | 
					#compdef rc-service
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if (( CURRENT == 2 )); then
 | 
					_rc_services() {
 | 
				
			||||||
  _arguments -s \
 | 
					  if [[ -n "${opt_args[(i)-l|--list]}" ]]; then
 | 
				
			||||||
    '(-e --exists)'{-e,--exists}"[tests if the service exists or not]" \
 | 
					    _nothing
 | 
				
			||||||
    '(-l --list)'{-l,--list}'[list all available services]' \
 | 
					  else
 | 
				
			||||||
    '(-r --resolve)'{-r,--resolve}'[resolve the service name to an init script]' \
 | 
					    _values 'service' $(rc-service -l)
 | 
				
			||||||
    '(-C --nocolor)'{-C,--nocolor}'[Disable color output]' \
 | 
					  fi
 | 
				
			||||||
    '(-v --verbose)'{-v,--verbose}'[Run verbosely]' \
 | 
					}
 | 
				
			||||||
    '(-q --quiet)'{-q,--quiet}'[Run quietly]'
 | 
					
 | 
				
			||||||
  _values "service" $(rc-service --list)
 | 
					_rc_actions() {
 | 
				
			||||||
else
 | 
					  local service="${line[1]}"
 | 
				
			||||||
  case $words[2] in
 | 
					
 | 
				
			||||||
    -e|--exists|-r|--resolve)
 | 
					  if [[ -n "${opt_args[(i)-e|--exists|-r|--resolve]}" ]] || ! $(rc-service -e $service) ; then
 | 
				
			||||||
      (( CURRENT > 3 )) && return 0
 | 
					    _nothing
 | 
				
			||||||
	  _values "service" $(rc-service --list)
 | 
					  else
 | 
				
			||||||
      ;;
 | 
					    local -a actions=(${(f)"$(rc-service -C $service describe 2>&1)"})
 | 
				
			||||||
    -*)
 | 
					    shift actions
 | 
				
			||||||
          return 0
 | 
					    actions=(${actions# \* })
 | 
				
			||||||
          ;;
 | 
					    actions=(${actions/:*})
 | 
				
			||||||
    *)
 | 
					    actions=(stop start restart describe zap ${actions[@]})
 | 
				
			||||||
      _values "action" stop start restart describe zap
 | 
					    _describe -V 'action' actions
 | 
				
			||||||
  ;;
 | 
					  fi
 | 
				
			||||||
  esac
 | 
					
 | 
				
			||||||
fi
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					_arguments -C -s \
 | 
				
			||||||
 | 
					  '(-e --exists)'{-e,--exists}'[tests if the service exists or not]' \
 | 
				
			||||||
 | 
					  '(-l --list)'{-l,--list}'[list all available services]' \
 | 
				
			||||||
 | 
					  '(-r --resolve)'{-r,--resolve}'[resolve the service name to an init script]' \
 | 
				
			||||||
 | 
					  '(-C --nocolor)'{-C,--nocolor}'[Disable color output]' \
 | 
				
			||||||
 | 
					  '(-v --verbose)'{-v,--verbose}'[Run verbosely]' \
 | 
				
			||||||
 | 
					  '(-q --quiet)'{-q,--quiet}'[Run quietly]' \
 | 
				
			||||||
 | 
					  '1:service:_rc_services' \
 | 
				
			||||||
 | 
					  '2:action:_rc_actions'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# vim: set et sw=2 ts=2 ft=zsh:
 | 
					# vim: set et sw=2 ts=2 ft=zsh:
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user