Search the FAQ Archives

3 - A - B - C - D - E - F - G - H - I - J - K - L - M
N - O - P - Q - R - S - T - U - V - W - X - Y - Z
faqs.org - Internet FAQ Archives

comp.sys.hp.hpux FAQ
Section - 5.3.9 How can I start the PFS daemons automatically at system startup?

( Single Page )
[ Usenet FAQs | Web FAQs | Documents | RFC Index | Neighborhoods ]


Top Document: comp.sys.hp.hpux FAQ
Previous Document: 5.3.8 Why are CDROM filenames all UPPERCASE with ;1 attached?
Next Document: 5.3.10 Where can I get updated disktab entries for third-party disks?
See reader questions & answers on this topic! - Help others by sharing your knowledge
Updated: 11/20/01

Create a pfs rc script, and associated config file, as follows:

===== CUT FROM HERE - PASTE TO /sbin/init.d/pfs =====
#!/usr/bin/sh
#
# pfs startup: Startup and kill script for the PFS file server
#

PATH=/sbin:/usr/sbin:/usr/bin
export PATH

if [ -r /etc/rc.config.d/pfs ] ; then
   . /etc/rc.config.d/pfs
fi

# return pid of the named process(es)
findproc() {
   pid=`ps -e |grep "$1" |sed -e 's/^  *//' -e 's/ .*//'`
   echo $pid
}

stat_pfs_fc()
{
   PFSD=`ps -ef|grep pfsd|grep -v grep|head -1|awk '{print $2}'`
   PFSM=`ps -ef|grep pfs_mount|grep -v grep|head -1|awk '{print $2}'`
}

kill_pfsd_fc()
{
   for PID in `ps -ef | grep pfsd | awk '{print $2}'` ; do
      if [ -n $PID ] ; then
         kill $PID 1>>/dev/null 2>>/dev/null
      fi
   done
}

kill_pfsmount_fc()
{
   for PID in `ps -ef | grep pfs_mount | awk '{print $2}'` ; do
      if [ -n $PID ] ; then
         kill $PID 1>>/dev/null 2>>/dev/null
      fi
   done

}

case "$1" in
"start_msg")
   echo "Starting PFS Daemons"
;;
"start")
   if [ "$RUN_PFS_SERVER" -ne 0 ] ; then
      stat_pfs_fc
      if [ "${PFSD}x" = "x" ] ; then
         echo "starting pfs_mountd"
         /usr/sbin/pfs_mountd -D$PFS_DAEMONS &
      else
         echo "pfsd is already running with PID $PFSD"
         echo "please stop and restart if necessary"
      fi
      if [ "${PFSM}x" = "x" ] ; then
         echo "starting pfsd"
         /usr/sbin/pfsd $PFS_DAEMONS &
      else
         echo "pfs_mount is already running with PID $PFSM"
         echo "please stop and restart if necessary"
      fi
      exit 0
   fi
   exit 2
;;
"stop_msg")
   echo "Terminating PFS Daemons "
;;
"stop")
   kill_pfsd_fc
   kill_pfsmount_fc
   kill_pfsd_fc
   kill_pfsmount_fc
;;
stat*)
   stat_pfs_fc
   if [ "${PFSD}x" = "x" ] ; then
      echo "pfsd is not running"
   else
      echo "pfsd is running"
   fi
   if [ "${PFSM}x" = "x" ] ; then
      echo "pfs_mount is not running"
   else
      echo "pfs_mountd is running"
   fi
;;
*)
   echo "Bad or missing arguments..."
   echo
   echo "Usage: $0 stop|start|start_msg|stop_msg|status"
;;
esac
exit 0
===== END CUT =====

  # chmod 555 /sbin/init.d/pfs
  # chown bin:bin /sbin/init.d/pfs
  # ln -s /sbin/init.d/pfs /sbin/rc2.d/S901pfs
  # ln -s /sbin/init.d/pfs /sbin/rc1.d/K099pfs

===== CUT FROM HERE, PASTE TO /etc/rc.config.d/pfs =====
#
# pfs configuration: set to a non-zero value to
# initiate pfsd and pfs_mountd at run_level 2
#
# Installed at /etc/rc.config.d/pfs
#
RUN_PFS_SERVER=1
# Set the number of PFS daemons to run
PFS_DAEMONS=4
===== END CUT =====

  # chmod 444 /etc/rc.config.d/pfs
  # chown bin:bin /etc/rc.config.d/pfs

User Contributions:

Comment about this article, ask questions, or add new information about this topic:




Top Document: comp.sys.hp.hpux FAQ
Previous Document: 5.3.8 Why are CDROM filenames all UPPERCASE with ;1 attached?
Next Document: 5.3.10 Where can I get updated disktab entries for third-party disks?

Single Page

[ Usenet FAQs | Web FAQs | Documents | RFC Index ]

Send corrections/additions to the FAQ Maintainer:
hpux.faq@gmail.com





Last Update March 27 2014 @ 02:11 PM