Date: Thu, 20 Sep 2018 20:57:09 -0700 From: Lee Brown <leeb@ratnaling.org> To: FreeBSD Hackers <freebsd-hackers@freebsd.org> Subject: Can't get pidfile to work in rc script Message-ID: <CAFPNf59m3BGLiNxkWK%2Bo5TRa=CNmh4vTmv7PZBmMbhYaBdj5Vw@mail.gmail.com>
next in thread | raw e-mail | index | archive | help
I'm trying to get 2 separate sshd's running. I've created /etc/rc.d/sshd_alternate but it always uses /var/run/sshd.pid and not /var/run/sshd_alternate.pid. I tried sshd_alternate_pidfile="${pidfile}" and procname="sshd" / procname="/usr/sbin/sshd" to no avail. Can somebody provide some assistance, I'm sure this is simple but I just can't fathom it. TIA #!/bin/sh # PROVIDE: sshd_alternate # REQUIRE: LOGIN FILESYSTEMS # KEYWORD: shutdown . /etc/rc.subr name="sshd_alternate" desc="Secure Shell Daemon (Alternate)" rcvar="sshd_alternate_enable" command="/usr/sbin/sshd" start_precmd="sshd_alternate_precmd" reload_precmd="sshd_alternate_configtest" restart_precmd="sshd_alternate_configtest" configtest_cmd="sshd_alternate_configtest" pidfile="/var/run/${name}.pid" extra_commands="configtest reload" sshd_alternate_configtest() { echo "Performing sanity check on ${name} configuration." eval ${command} ${sshd_alternate_flags} -t } sshd_alternate_precmd() { run_rc_command configtest } load_rc_config $name run_rc_command "$1"
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAFPNf59m3BGLiNxkWK%2Bo5TRa=CNmh4vTmv7PZBmMbhYaBdj5Vw>