From owner-freebsd-hackers@freebsd.org Fri Sep 21 03:57:12 2018 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E983C10B1D83 for ; Fri, 21 Sep 2018 03:57:11 +0000 (UTC) (envelope-from leeb@ratnaling.org) Received: from mail-it1-x136.google.com (mail-it1-x136.google.com [IPv6:2607:f8b0:4864:20::136]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7DAE28C841 for ; Fri, 21 Sep 2018 03:57:11 +0000 (UTC) (envelope-from leeb@ratnaling.org) Received: by mail-it1-x136.google.com with SMTP id j198-v6so169438ita.0 for ; Thu, 20 Sep 2018 20:57:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ratnaling-org.20150623.gappssmtp.com; s=20150623; h=mime-version:from:date:message-id:subject:to; bh=B30Kk9Iy2ZdedGX8p+G/ceDNqSDomjbeN5LtPkp5Zzc=; b=KW9P3jvDTkfA8tH9Z27BlQDikN14JcbApcuFNJOUy87MSDjVhJPccKKD4gMGo89kwy CIGGfx3wlNK9UIlg4ILeqGvIyBR6JfVO2jKEig6e1WmlRylZHbShns1cr92JwMymRGzN biHbn6dDJocMuSPrP7XhKV+pDfN/TxEDi+WOy+kH/mCX6u8DI3eA60XqX8LU+hGrar8K Y+LnValmU5IfooGiAUNI4ESLeEWq06xPoXBO7Nh/EtBEnAQ0ZGBAo/1J3ad+GeVjOLuX LcYNrZlpl6IcC9dFZrSgt68rLUfmO4EpipuEqe+gR8oxTuv2MHo9auGnEwMmRDAPAxJX EAnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=B30Kk9Iy2ZdedGX8p+G/ceDNqSDomjbeN5LtPkp5Zzc=; b=He2Vi7932uM9LVwNbFvdri3vCqyLOPndczZE4l48/qxkeUo7dTlWwq7OqVw6u9da6o HD8iNaAfLsqvSE5rmFdAN3WKPC/05t7bKavKkBYOi2nrqSVMf4+VwEjufrEaEUfFUWpl WaqO0eZOBxN9dqZymPM4FTct1jLj15EOlCY99SSlgij+HRN92fDmzTcMVxoc//FdjQZu fy47xJik/OgO0VvEgMiZqXznNpqA4irm6Ht+UQqylW4OEOazFKk95t67Xp5Q9kbDfZVP XoOpt7X/tVQq6L40Ns9Q4ckfG2ip9MCTtACQegmNMdF3F2Y4u/rbnAN1JjkLaOW4NJFS 9HYg== X-Gm-Message-State: APzg51BflU+nHocaoTS/RsBitmznXqcagppZXYFi3p7XQfyjjBUoV4yz tZCqj4fgyjQ9fJBPlikOdKeZSVuNCvcKYJxfXq6JhGSAJhGafg== X-Google-Smtp-Source: ANB0VdaiFx8kzAGXT+W2ZrsoN1Vtprtt0zOqfH+1WhXJNy4Rz/dNZWbruX+WSZrRMVOWrre+ZAoEVu+leEjXs0SEfWs= X-Received: by 2002:a24:da47:: with SMTP id z68-v6mr2270208itg.59.1537502230374; Thu, 20 Sep 2018 20:57:10 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a4f:d025:0:0:0:0:0 with HTTP; Thu, 20 Sep 2018 20:57:09 -0700 (PDT) From: Lee Brown Date: Thu, 20 Sep 2018 20:57:09 -0700 Message-ID: Subject: Can't get pidfile to work in rc script To: FreeBSD Hackers Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.27 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Sep 2018 03:57:12 -0000 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"