Skip to content

Commit

Permalink
change default name of pid file from sshd.pid to hpnsshd.pid
Browse files Browse the repository at this point in the history
this makes it easier when dealing with concurrent installs of OpenSSH and HPNSSH
  • Loading branch information
rapier1 committed Jan 27, 2022
1 parent 9146168 commit ebf1fee
Show file tree
Hide file tree
Showing 12 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion INSTALL
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ $DISPLAY environment variable. Some broken systems need this.
--with-default-path=PATH allows you to specify a default $PATH for sessions
started by sshd. This replaces the standard path entirely.

--with-pid-dir=PATH specifies the directory in which the sshd.pid file is
--with-pid-dir=PATH specifies the directory in which the hpnsshd.pid file is
created.

--with-xauth=PATH specifies the location of the xauth binary
Expand Down
2 changes: 1 addition & 1 deletion Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ PATHSUBS = \
-e 's|/etc/ssh/ssh_host_dsa_key|$(sysconfdir)/ssh_host_dsa_key|g' \
-e 's|/etc/ssh/ssh_host_rsa_key|$(sysconfdir)/ssh_host_rsa_key|g' \
-e 's|/etc/ssh/ssh_host_ed25519_key|$(sysconfdir)/ssh_host_ed25519_key|g' \
-e 's|/var/run/sshd.pid|$(piddir)/sshd.pid|g' \
-e 's|/var/run/hpnsshd.pid|$(piddir)/hpnsshd.pid|g' \
-e 's|/etc/moduli|$(sysconfdir)/moduli|g' \
-e 's|/etc/ssh/moduli|$(sysconfdir)/moduli|g' \
-e 's|/etc/ssh/sshrc|$(sysconfdir)/sshrc|g' \
Expand Down
4 changes: 2 additions & 2 deletions buildpkg.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ then
PRE_INS_STOP=no
POST_INS_START=no
# determine if should restart the daemon
if [ -s ${piddir}/sshd.pid ] && \\
if [ -s ${piddir}/hpnsshd.pid ] && \\
/usr/bin/svcs -H $OPENSSH_FMRI 2>&1 | egrep "^online" > /dev/null 2>&1
then
ans=\`ckyorn -d n \\
Expand Down Expand Up @@ -580,7 +580,7 @@ case \$ans in
esac
# determine if should restart the daemon
if [ -s ${piddir}/sshd.pid -a -f ${TEST_DIR}/etc/init.d/${SYSVINIT_NAME} ]
if [ -s ${piddir}/hpnsshd.pid -a -f ${TEST_DIR}/etc/init.d/${SYSVINIT_NAME} ]
then
ans=\`ckyorn -d n \\
-p "Should the running sshd daemon be restarted? ${DEF_MSG}"\` || exit \$?
Expand Down
4 changes: 2 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -5188,7 +5188,7 @@ AC_ARG_WITH([bsd-auth],
]
)

# Where to place sshd.pid
# Where to place hpnsshd.pid
piddir=/var/run
# make sure the directory exists
if test ! -d $piddir ; then
Expand All @@ -5199,7 +5199,7 @@ if test ! -d $piddir ; then
fi

AC_ARG_WITH([pid-dir],
[ --with-pid-dir=PATH Specify location of sshd.pid file],
[ --with-pid-dir=PATH Specify location of hpnsshd.pid file],
[
if test -n "$withval" && test "x$withval" != "xno" && \
test "x${withval}" != "xyes"; then
Expand Down
2 changes: 1 addition & 1 deletion contrib/hpux/sshd.rc
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export PATH

WHAT='OpenSSH'
WHAT_PATH=/opt/openssh/sbin/sshd
WHAT_PID=/var/run/sshd.pid
WHAT_PID=/var/run/hpnsshd.pid
WHAT_CONFIG=/etc/rc.config.d/sshd

# NOTE: If your script executes in run state 0 or state 1, then /usr might
Expand Down
2 changes: 1 addition & 1 deletion contrib/redhat/openssh.spec
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ perl -pi -e "s|$RPM_BUILD_ROOT||g" $RPM_BUILD_ROOT%{_mandir}/man*/*
rm -rf $RPM_BUILD_ROOT

%triggerun server -- ssh-server
if [ "$1" != 0 -a -r /var/run/sshd.pid ] ; then
if [ "$1" != 0 -a -r /var/run/hpnsshd.pid ] ; then
touch /var/run/sshd.restart
fi

Expand Down
4 changes: 2 additions & 2 deletions contrib/redhat/sshd.init
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# config: /etc/ssh/ssh_host_key.pub
# config: /etc/ssh/ssh_random_seed
# config: /etc/ssh/sshd_config
# pidfile: /var/run/sshd.pid
# pidfile: /var/run/hpnsshd.pid

# source function library
. /etc/rc.d/init.d/functions
Expand All @@ -23,7 +23,7 @@ prog="sshd"

# Some functions to make the below more readable
SSHD=/usr/sbin/sshd
PID_FILE=/var/run/sshd.pid
PID_FILE=/var/run/hpnsshd.pid

do_restart_sanity_check()
{
Expand Down
2 changes: 1 addition & 1 deletion opensshd.init.in
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ sysconfdir=@sysconfdir@
piddir=@piddir@

SSHD=$prefix/sbin/sshd
PIDFILE=$piddir/sshd.pid
PIDFILE=$piddir/hpnsshd.pid
PidFile=`grep "^PidFile" ${sysconfdir}/sshd_config | tr "=" " " | awk '{print $2}'`
[ X$PidFile = X ] || PIDFILE=$PidFile
SSH_KEYGEN=$prefix/bin/ssh-keygen
Expand Down
2 changes: 1 addition & 1 deletion pathnames.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
* The process id of the daemon listening for connections is saved here to
* make it easier to kill the correct daemon when necessary.
*/
#define _PATH_SSH_DAEMON_PID_FILE _PATH_SSH_PIDDIR "/sshd.pid"
#define _PATH_SSH_DAEMON_PID_FILE _PATH_SSH_PIDDIR "/hpnsshd.pid"

/*
* The directory in user's home directory in which the files reside. The
Expand Down
2 changes: 1 addition & 1 deletion sshd.8
Original file line number Diff line number Diff line change
Expand Up @@ -993,7 +993,7 @@ during privilege separation in the pre-authentication phase.
The directory should not contain any files and must be owned by root
and not group or world-writable.
.Pp
.It Pa /var/run/sshd.pid
.It Pa /var/run/hpnsshd.pid
Contains the process ID of the
.Nm
listening for connections (if there are several daemons running
Expand Down
2 changes: 1 addition & 1 deletion sshd_config
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ AuthorizedKeysFile .ssh/authorized_keys
#ClientAliveInterval 0
#ClientAliveCountMax 3
#UseDNS no
#PidFile /var/run/sshd.pid
#PidFile /var/run/hpnsshd.pid
#MaxStartups 10:30:100
#PermitTunnel no
#ChrootDirectory none
Expand Down
2 changes: 1 addition & 1 deletion sshd_config.5
Original file line number Diff line number Diff line change
Expand Up @@ -1469,7 +1469,7 @@ SSH daemon, or
.Cm none
to not write one.
The default is
.Pa /var/run/sshd.pid .
.Pa /var/run/hpnsshd.pid .
.It Cm Port
Specifies the port number that
.Xr sshd 8
Expand Down

0 comments on commit ebf1fee

Please sign in to comment.