Operating System - HP-UX
1819871 Members
2540 Online
109607 Solutions
New Discussion юеВ

Re: auto start pfs_mountd & psfd

 
Robert K.Scrimger_1
Occasional Advisor

auto start pfs_mountd & psfd

The pfs_mountd man page recommends starting the daemon with an rc script. There is however, no run level recommendation. I would like to start both pfs_mountd and pfsd at boot time. Is rc2.d the right place for the S script? Is there any concern about not killing cleanly with a K script? Thanks.
13 REPLIES 13
James R. Ferguson
Acclaimed Contributor

Re: auto start pfs_mountd & psfd

Hi Robert:

The proper place for the startup script would be 'rc3.d'. The rc.d directory guidelines are: one (1) for core services; two (2) for multiuser run-state; three (3) for networked, multi-user; and four (4) for graphical interfaces.

If a start script is placed in directory '/sbin/rc{X}.d' then its corresponding kill script is put in directory '/sbin/rc{X-1}.d'. Thus, your start script would go into 'rc3.d' and your kill script in 'rc2.d'.

Remember, in the case of 'pfs_mounts' to stop (kill) the deamons in the reverse order that they were started.

Regards!

...JRF...
Christopher McCray_1
Honored Contributor

Re: auto start pfs_mountd & psfd

I would probably put it in rc3.d, although rc2.d would be okay(after all nfs has been started). I don't believe any thing bad will come about by not using a K script; one would normally do a kill on them anyway or log out of the window with the processes.

Hope this helps
Chris
It wasn't me!!!!
Robert K.Scrimger_1
Occasional Advisor

Re: auto start pfs_mountd & psfd

OK, I understand the run level part, thanks. I'm a rookie HPUX scripter, is there a good example of how to trap the pids for the K script? (Solaris' pkill command makes this really easy.)
Sanjay_6
Honored Contributor

Re: auto start pfs_mountd & psfd

Hi,

you can try this,

kill `ps -ef |grep process_name |grep -v grep |awk '{print $5}'`

Hope this helps.

Regds

James R. Ferguson
Acclaimed Contributor

Re: auto start pfs_mountd & psfd

Hi (again) Robert:

You should start with '/sbin/init.d/template' as the template for your startup/shutdown script. A part of this script *is* a function to isolate and kill a process.

Regards!

...JRF...
Robert K.Scrimger_1
Occasional Advisor

Re: auto start pfs_mountd & psfd

Hello Again all. I created the attached script based on the template. I get the appropriate checklist item on start up, and /etc/rc.log containds the message from the success path, BUT the daemons are NOT running on login. If I execute this script from the command line with a "start" argument, the daemons start. They do not start when initiated by rc. The symbolic links are /sbin/rc2.d/S886pfs_mount and /sbin/rc1.d/K116pfs_mount. I tried them in rc3.d and rc2.d respectively and they didn't work there either.
Robert K.Scrimger_1
Occasional Advisor

Re: auto start pfs_mountd & psfd

BTT, this is still a problem
Pete Randall
Outstanding Contributor

Re: auto start pfs_mountd & psfd

The entries in rc(n).d are supposed to link to scripts in /sbin/init.d. In other words, your script goes in /sbin/init.d and you link the Start and Kill scripts from the appropriate rc(n).d directory.

Pete

Pete
Robert K.Scrimger_1
Occasional Advisor

Re: auto start pfs_mountd & psfd

Thanks Pete, I guess it's not clear from my desciption, but it is as you have described. This script attached to my 15 February reply lives in /sbin/init.d, and the links are in the rc(x).d directories as described in the same entry.
Rob
Pete Randall
Outstanding Contributor

Re: auto start pfs_mountd & psfd

Sorry Robert, re-reading your posts told me that. This rings a bell for me but it's not ringing loudly enough yet. I'll keep working on it.

Pete

Pete
James R. Ferguson
Acclaimed Contributor

Re: auto start pfs_mountd & psfd

Hi Robert:

You need to start your script after 'nfs.server' in runlevel-3. Some of the deamons necessary to support PFS mounts are started therein.

Regards!

...JRF...
Wodisch
Honored Contributor

Re: auto start pfs_mountd & psfd

HI,

be careful to "kill" your PFSdaemons *before* "killing" your NFS daemons! And do not even try to kill the wrong ones (i.e. do NOT kill those ending in ".rpc"!), or you'll have to reboot!

kill $(UNIX95=x ps -C pfsd -o pid)
kill $(UNIX95=x ps -C pfs_mountd -o pid)

are your friends :-)

Just my $0.02,
Wodisch
pap
Respected Contributor

Re: auto start pfs_mountd & psfd

HI,
The best place to put startup scripts for pfs are /sbin/rc3.d

and kill the processes in runlevel 1.

-pap
"Winners don't do different things , they do things differently"