mirror of
https://git.FreeBSD.org/ports.git
synced 2025-01-14 07:43:06 +00:00
9aac569eaa
Where necessary add $FreeBSD$ to the file No PORTREVISION bump necessary because this is a no-op
54 lines
1.1 KiB
Bash
54 lines
1.1 KiB
Bash
#!/bin/sh
|
|
|
|
# $FreeBSD$
|
|
|
|
# Start or stop noattach
|
|
|
|
# PROVIDE: noattach
|
|
# REQUIRE: DAEMON
|
|
# BEFORE: mail
|
|
# KEYWORD: shutdown
|
|
#
|
|
|
|
# Define these noattach_* variables in one of these files:
|
|
# /etc/rc.conf
|
|
# /etc/rc.conf.local
|
|
# /etc/rc.conf.d/noattach
|
|
#
|
|
# DO NOT CHANGE THESE DEFAULT VALUES HERE
|
|
#
|
|
# noattach_flags Flags to noattach
|
|
|
|
noattach_enable=${noattach_enable:-"NO"} # Enable noattach
|
|
noattach_pidfile=${noattach_pidfile:-"/var/run/noattach.pid"} # Path to pidfile
|
|
noattach_socket=${noattach_socket:-"/var/run/noattach"} # Path to socket
|
|
|
|
. /etc/rc.subr
|
|
|
|
name="noattach"
|
|
rcvar="noattach_enable"
|
|
command="%%PREFIX%%/libexec/${name}"
|
|
required_files="%%PREFIX%%/etc/noattach.patterns"
|
|
start_precmd="noattach_prestart"
|
|
stop_postcmd="noattach_poststop"
|
|
reload_cmd="noattach_reload"
|
|
extra_commands="reload"
|
|
|
|
noattach_prestart() {
|
|
/bin/rm -f "${pidfile}" "${noattach_socket}"
|
|
}
|
|
|
|
noattach_poststop() {
|
|
/bin/rm -f "${pidfile}" "${noattach_socket}"
|
|
}
|
|
|
|
noattach_reload() {
|
|
kill -USR1 `head -1 "${pidfile}"`
|
|
}
|
|
|
|
load_rc_config $name
|
|
pidfile="${noattach_pidfile}"
|
|
command_args="-p local:${noattach_socket} ${noattach_flags}"
|
|
|
|
run_rc_command "$1"
|