mirror of
				https://github.com/caddyserver/caddy.git
				synced 2025-10-31 02:27:19 -04:00 
			
		
		
		
	implemented sourcing of default file for sysvinit (#1984)
* implemented source of default file for sysvinit Signed-off-by: root360-AndreasUlm <andreas.ulm@root360.de> * added documentation in README Signed-off-by: root360-AndreasUlm <andreas.ulm@root360.de> * fixed sourcing command for sh Signed-off-by: root360-AndreasUlm <andreas.ulm@root360.de> * implemented source of default file for sysvinit Signed-off-by: root360-AndreasUlm <andreas.ulm@root360.de> * added documentation in README Signed-off-by: root360-AndreasUlm <andreas.ulm@root360.de> * fixed sourcing command for sh Signed-off-by: root360-AndreasUlm <andreas.ulm@root360.de> * implemented DAEMONOPTS overwrite Signed-off-by: root360-AndreasUlm <andreas.ulm@root360.de>
This commit is contained in:
		
							parent
							
								
									d35719daed
								
							
						
					
					
						commit
						8a326d4dc1
					
				
							
								
								
									
										16
									
								
								dist/init/linux-sysvinit/README.md
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										16
									
								
								dist/init/linux-sysvinit/README.md
									
									
									
									
										vendored
									
									
								
							| @ -9,3 +9,19 @@ Usage | ||||
| * Ensure that the folder `/etc/caddy` exists and that the folder `/etc/ssl/caddy` is owned by `www-data`. | ||||
| * Create a Caddyfile in `/etc/caddy/Caddyfile` | ||||
| * Now you can use `service caddy start|stop|restart|reload|status` as `root`. | ||||
| 
 | ||||
| Init script manipulation | ||||
| ----- | ||||
| 
 | ||||
| The init script supports configuration via the following files: | ||||
| * `/etc/default/caddy` ( Debian based https://www.debian.org/doc/manuals/debian-reference/ch03.en.html#_the_default_parameter_for_each_init_script ) | ||||
| * `/etc/sysconfig/caddy` ( CentOS based https://www.centos.org/docs/5/html/5.2/Deployment_Guide/s1-sysconfig-files.html ) | ||||
| 
 | ||||
| The following variables can be changed: | ||||
| * DAEMON: path to the caddy binary file (default: `/usr/local/bin/caddy`) | ||||
| * DAEMONUSER: user used to run caddy (default: `www-data`) | ||||
| * PIDFILE: path to the pidfile (default: `/var/run/$NAME.pid`) | ||||
| * LOGFILE: path to the log file for caddy daemon (not for access logs) (default: `/var/log/$NAME.log`) | ||||
| * CONFIGFILE: path to the caddy configuration file (default: `/etc/caddy/Caddyfile`) | ||||
| * CADDYPATH: path for SSL certificates managed by caddy (default: `/etc/ssl/caddy`) | ||||
| * ULIMIT: open files limit (default: `8192`) | ||||
|  | ||||
							
								
								
									
										18
									
								
								dist/init/linux-sysvinit/caddy
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										18
									
								
								dist/init/linux-sysvinit/caddy
									
									
									
									
										vendored
									
									
								
							| @ -20,18 +20,30 @@ DAEMONUSER=www-data | ||||
| PIDFILE=/var/run/$NAME.pid | ||||
| LOGFILE=/var/log/$NAME.log | ||||
| CONFIGFILE=/etc/caddy/Caddyfile | ||||
| DAEMONOPTS="-agree=true -log=$LOGFILE -conf=$CONFIGFILE" | ||||
| 
 | ||||
| USERBIND="setcap cap_net_bind_service=+ep" | ||||
| STOP_SCHEDULE="${STOP_SCHEDULE:-QUIT/5/TERM/5/KILL/5}" | ||||
| CADDYPATH=/etc/ssl/caddy | ||||
| ULIMIT=8192 | ||||
| 
 | ||||
| test -x $DAEMON || exit 0 | ||||
| 
 | ||||
| # allow overwriting variables | ||||
| #   Debian based | ||||
| [ -e "/etc/default/caddy" ] && . /etc/default/caddy | ||||
| #   CentOS based | ||||
| [ -e "/etc/sysconfig/caddy" ] && . /etc/sysconfig/caddy | ||||
| 
 | ||||
| if [ -z "$DAEMONOPTS" ]; then | ||||
|     # daemon options | ||||
|     DAEMONOPTS="-agree=true -log=$LOGFILE -conf=$CONFIGFILE" | ||||
| fi | ||||
| 
 | ||||
| # Set the CADDYPATH; Let's Encrypt certificates will be written to this directory. | ||||
| export CADDYPATH=/etc/ssl/caddy | ||||
| export CADDYPATH | ||||
| 
 | ||||
| # Set the ulimits | ||||
| ulimit -n 8192 | ||||
| ulimit -n ${ULIMIT} | ||||
| 
 | ||||
| 
 | ||||
| start() { | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user