/usr/local/etc/rc.d/serviio_manuel start /usr/local/etc/rc.d/serviio_web_manuel start
serviio_manuel_enable="YES" serviio_web_manuel_enable="YES"
... ############################################################ # Config pour Serviio # ############################################################ serviio_manuel_enable="YES" serviio_web_manuel_enable="YES" ...
#!/bin/sh # # PROVIDE: serviio_manuel # KEYWORD: shutdown # # Add the following line to /etc/rc.conf[.local] to enable serviio: # # serviio_manuel_enable="YES" . /etc/rc.subr # Definition des variables app_home="/usr/local/etc/serviio" name="serviio_manuel" runcmd="${app_home}/bin/serviio.sh" search_pattern="serviio" serviio_user=${serviio_user-"dlna"} _dirs="/var/db/serviio /var/log/serviio" command_args="$serviio_args &" # Definition des variables du Framework pidfile="/var/run/${name}.pid" rcvar="${name}_enable" command="daemon" flags="-f -p ${pidfile} ${runcmd}" # Definition des Fonctions status_cmd="app_status" start_precmd="app_start_precmd" start_cmd="app_start" start_postcmd="app_start_postcmd" stop_precmd="app_stop_precmd" stop_cmd="app_stop" stop_postcmd="app_stop_postcmd" getpid() { ps -aux | grep "${search_pattern}" | awk -v pid="${1:-0}" '$2==pid {print $2}' } getppid() { ps -auxfl | awk -v ppid="${pid_run}" '$13==ppid {print $2}' } app_status() { [ -f ${pidfile} ] && pid_file=$(cat ${pidfile}) pid_run=$(getpid ${pid_file}) pid_run_java=$(getppid ${pid_run}) if [ ${pid_file:-0} -eq ${pid_run:-1} ] then echo "STATUS : ${name} is running (on PID ${pid_run} and Java on PID ${pid_run_java})" else echo "STATUS : ${name} is NOT running" fi } app_start_precmd() { [ -f ${pidfile} ] && pid_file=$(cat ${pidfile}) pid_run=$(getpid ${pid_file}) if [ ${pid_file:-0} -eq ${pid_run:-1} ] then echo "${name} is already running !" else mkdir -p $_dirs; chown $serviio_user $_dirs fi } app_start() { echo "Starting ${name}..." daemon ${flags} } app_start_postcmd() { [ -f ${pidfile} ] && pid_file=$(cat ${pidfile}) pid_run=$(getpid ${pid_file}) if [ ${pid_file:-0} -eq ${pid_run:-1} ] then echo "${name} started !" else echo "${name} cannot be started" fi } app_stop_precmd() { } app_stop() { echo "Stopping ${name}..." [ -f ${pidfile} ] && pid_file=$(cat ${pidfile}) pid_run=$(getpid ${pid_file}) pid_run_java=$(getppid ${pid_run}) if [ ${pid_file:-0} -eq ${pid_run:-1} ] then kill -9 ${pid_run} kill -9 ${pid_run_java} fi } app_stop_postcmd() { [ -f ${pidfile} ] && pid_file=$(cat ${pidfile}) pid_run=$(getpid ${pid_file}) if [ "${pid_run}" = "" ] then [ -f ${pidfile} ] && rm -f ${pidfile} echo "${name} stopped" echo "Goodbye !" else echo "${name} cannot be stopped" fi } # Fonctions d'appel load_rc_config ${name} run_rc_command "$1"
#!/bin/sh # # PROVIDE: serviio_web_manuel # REQUIRE: serviio_manuel # KEYWORD: shutdown # # Add the following line to /etc/rc.conf[.local] to enable serviio: # # serviio_web_manuel_enable="YES" . /etc/rc.subr # Definition des variables app_home="/usr/local/etc/serviio" name="serviio_web_manuel" runcmd="${app_home}/bin/serviio-webui.sh" search_pattern="serviio-webui" # Definition des variables du Framework pidfile="/var/run/${name}.pid" rcvar="${name}_enable" command="daemon" flags="-f -p ${pidfile} ${runcmd}" # Definition des Fonctions status_cmd="app_status" start_precmd="app_start_precmd" start_cmd="app_start" start_postcmd="app_start_postcmd" stop_precmd="app_stop_precmd" stop_cmd="app_stop" stop_postcmd="app_stop_postcmd" getpid() { ps -aux | grep "${search_pattern}" | awk -v pid="${1:-0}" '$2==pid {print $2}' } getppid() { ps -auxfl | awk -v ppid="${pid_run}" '$13==ppid {print $2}' } app_status() { [ -f ${pidfile} ] && pid_file=$(cat ${pidfile}) pid_run=$(getpid ${pid_file}) pid_run_java=$(getppid ${pid_run}) if [ ${pid_file:-0} -eq ${pid_run:-1} ] then echo "STATUS : ${name} is running (on PID ${pid_run} and Java on PID ${pid_run_java})" else echo "STATUS : ${name} is NOT running" fi } app_start_precmd() { [ -f ${pidfile} ] && pid_file=$(cat ${pidfile}) pid_run=$(getpid ${pid_file}) if [ ${pid_file:-0} -eq ${pid_run:-1} ] then echo "${name} is already running !" else fi } app_start() { echo "Starting ${name}..." daemon ${flags} } app_start_postcmd() { [ -f ${pidfile} ] && pid_file=$(cat ${pidfile}) pid_run=$(getpid ${pid_file}) if [ ${pid_file:-0} -eq ${pid_run:-1} ] then echo "${name} started !" else echo "${name} cannot be started" fi } app_stop_precmd() { } app_stop() { echo "Stopping ${name}..." [ -f ${pidfile} ] && pid_file=$(cat ${pidfile}) pid_run=$(getpid ${pid_file}) pid_run_java=$(getppid ${pid_run}) if [ ${pid_file:-0} -eq ${pid_run:-1} ] then kill -9 ${pid_run} kill -9 ${pid_run_java} fi } app_stop_postcmd() { [ -f ${pidfile} ] && pid_file=$(cat ${pidfile}) pid_run=$(getpid ${pid_file}) if [ "${pid_run}" = "" ] then [ -f ${pidfile} ] && rm -f ${pidfile} echo "${name} stopped" echo "Goodbye !" else echo "${name} cannot be stopped" fi } # Fonctions d'appel load_rc_config ${name} run_rc_command "$1"
rcorder /etc/rc.d/* /usr/local/etc/rc.d/*
... # PROVIDE: serviio_manuel # REQUIRE: LOGIN cleanvar # KEYWORD: shutdown ...
rcorder /etc/rc.d/* /usr/local/etc/rc.d/* /etc/rc.d/sysctl /etc/rc.d/hostid /etc/rc.d/zvol /etc/rc.d/dumpon /etc/rc.d/ddb /etc/rc.d/initrandom /etc/rc.d/geli /etc/rc.d/gbde /etc/rc.d/encswap /etc/rc.d/ccd /etc/rc.d/swap1 /etc/rc.d/fsck /etc/rc.d/root /etc/rc.d/mdconfig /etc/rc.d/hostid_save /etc/rc.d/mountcritlocal /etc/rc.d/zfs /etc/rc.d/FILESYSTEMS /etc/rc.d/kld /etc/rc.d/var /etc/rc.d/random /etc/rc.d/adjkerntz /etc/rc.d/atm1 /etc/rc.d/hostname /etc/rc.d/ip6addrctl /etc/rc.d/kldxref /etc/rc.d/netoptions /etc/rc.d/sppp /etc/rc.d/ipfilter /etc/rc.d/ipnat /etc/rc.d/ipfs /etc/rc.d/serial /etc/rc.d/cleanvar /etc/rc.d/netif /etc/rc.d/devd /etc/rc.d/ipsec /etc/rc.d/atm2 /etc/rc.d/pfsync /etc/rc.d/pflog /etc/rc.d/pf /etc/rc.d/stf /etc/rc.d/ppp /etc/rc.d/faith /etc/rc.d/routing /etc/rc.d/mroute6d /etc/rc.d/nsswitch /etc/rc.d/rtsold /etc/rc.d/static_ndp /etc/rc.d/static_arp /etc/rc.d/bridge /etc/rc.d/resolv /etc/rc.d/route6d /etc/rc.d/mrouted /etc/rc.d/routed /etc/rc.d/defaultroute /etc/rc.d/ipfw /etc/rc.d/NETWORKING /etc/rc.d/netwait /etc/rc.d/mountcritremote /etc/rc.d/accounting /etc/rc.d/ldconfig /etc/rc.d/devfs /etc/rc.d/ipmon /etc/rc.d/mdconfig2 /etc/rc.d/newsyslog /etc/rc.d/syslogd /etc/rc.d/savecore /etc/rc.d/archdep /etc/rc.d/abi /etc/rc.d/SERVERS /etc/rc.d/named /etc/rc.d/ntpdate /etc/rc.d/rpcbind /etc/rc.d/nfsclient /etc/rc.d/nisdomain /etc/rc.d/ypserv /etc/rc.d/ypbind /etc/rc.d/ypset /etc/rc.d/amd /etc/rc.d/atm3 /etc/rc.d/auditd /etc/rc.d/tmp /etc/rc.d/cleartmp /etc/rc.d/dmesg /etc/rc.d/hastd /etc/rc.d/ipxrouted /etc/rc.d/kerberos /etc/rc.d/kadmind /etc/rc.d/keyserv /etc/rc.d/kpasswdd /etc/rc.d/nfsuserd /etc/rc.d/gssd /etc/rc.d/quota /etc/rc.d/mountd /etc/rc.d/nfsd /etc/rc.d/statd /etc/rc.d/lockd /etc/rc.d/pppoed /etc/rc.d/pwcheck /etc/rc.d/virecover /etc/rc.d/DAEMON /etc/rc.d/apm /etc/rc.d/apmd /etc/rc.d/bootparams /etc/rc.d/hcsecd /etc/rc.d/bthidd /etc/rc.d/local /etc/rc.d/lpd /etc/rc.d/motd /etc/rc.d/mountlate /etc/rc.d/nscd /etc/rc.d/ntpd /etc/rc.d/powerd /etc/rc.d/rarpd /etc/rc.d/rctl /etc/rc.d/sdpd /etc/rc.d/rfcomm_pppd_server /etc/rc.d/rtadvd /etc/rc.d/rwho /etc/rc.d/timed /etc/rc.d/ugidfw /etc/rc.d/yppasswdd /usr/local/etc/rc.d/samba /etc/rc.d/LOGIN /usr/local/etc/rc.d/webmin /usr/local/etc/rc.d/vsftpd /usr/local/etc/rc.d/serviio_manuel /usr/local/etc/rc.d/serviio_web_manuel /usr/local/etc/rc.d/sabnzbd /usr/local/etc/rc.d/rsyncd /usr/local/etc/rc.d/php-fpm rcorder: requirement `SYSLOG' in file `/usr/local/etc/rc.d/noip' has no providers. /usr/local/etc/rc.d/noip /usr/local/etc/rc.d/htcacheclean /usr/local/etc/rc.d/ffserver /usr/local/etc/rc.d/fail2ban /usr/local/etc/rc.d/clamav-clamd /usr/local/etc/rc.d/clamav-freshclam /usr/local/etc/rc.d/apache22 /etc/rc.d/ypxfrd /etc/rc.d/ypupdated /etc/rc.d/wpa_supplicant /etc/rc.d/watchdogd /etc/rc.d/ubthidhci /etc/rc.d/syscons /etc/rc.d/sshd /etc/rc.d/sendmail /etc/rc.d/cron /etc/rc.d/jail /etc/rc.d/localpkg /etc/rc.d/securelevel /etc/rc.d/power_profile /etc/rc.d/othermta /etc/rc.d/nfscbd /etc/rc.d/natd /etc/rc.d/msgs /etc/rc.d/moused /etc/rc.d/mixer /etc/rc.d/inetd /etc/rc.d/hostapd /etc/rc.d/gptboot /etc/rc.d/geli2 /etc/rc.d/ftpd /etc/rc.d/ftp-proxy /etc/rc.d/dhclient /etc/rc.d/bsnmpd /etc/rc.d/bluetooth /etc/rc.d/bgfsck /etc/rc.d/addswap
service serviio_web_manuel start