Operating System - HP-UX
1833023 Members
2998 Online
110049 Solutions
New Discussion

Temporily disable service

 
hanyyu1
Advisor

Temporily disable service

If I want to shutdown a system service ( eg. vsftpd , rsh ) in a period of date , for example , if I want these service NOT to running between 12:00 and 13:00 everyday , is it possible ? thx
4 REPLIES 4
Luk Vandenbussche
Honored Contributor

Re: Temporily disable service

Of course, it is possible,

Put i in the crontab

#Stop every day at 12:00
0 12 * * * vfstp stop
#Start every day at 13:00
0 13 * * * vsftp start
Cem Tugrul
Esteemed Contributor

Re: Temporily disable service

Hello Hanyyu1,

As the reply mentioned you can easily manage
it from crontab. As your need 12:00-13:00
then;
0 12 * * * /sbin/init.d/service stop
0 13 * * * /sbin/init.d/service start

Good Luck &Happy New YeaR

Our greatest duty in this life is to help others. And please, if you can't
Ralph Grothe
Honored Contributor

Re: Temporily disable service

Many stand-alone servers also allow you to configure time periods of access restrictions and ACLs or similar.
Since I don't use vftpd I cannot tell
if it supports this, but its docs will surely tell you (maybe even comments in its major config file).
With servers that are started via inetd it's a bit different (like e.g. remshd, is it that what you meant when mentioning rsh?).
You could either set up a cronjob that comments such a service in inetd.conf and afterwards inititiates a reconfiguration restart (e.g. /usr/sbin/inetd -c).
But probably a better option would be to use a tcpwrapper or similar filter.
But again, since I don't use a tcpwrapper on HP-UX I cannot tell what features it offers.
From e.g. Linux xinetd I know that you can configure time restricted access.
Madness, thy name is system administration
Sivakumar TS
Honored Contributor

Re: Temporily disable service


Hi,

You can also make script containing the command lines for starting/stopping the required services and make a single crontab entry to run THIS script at your required TIME.

This may give you a flexiblity of editing the script to make any changes in the services to be started/stopped.

With Regards,

Siva.
Nothing is Impossible !