starting smartd automatically

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

starting smartd automatically

Cygwin list mailing list
I have (in my very limited time with cygwin) noticed that
some daemons (sshd, syslog-ng) are run as Windows
services, and started at boot.

I have installed smartmontools, and see that it has a more
traditional (linux) installation. The smartd start script is in
/etc/rc.d/init.d/.

I am wondering if there is some way to start this as soon
as the machine is booted (even before logging in).

Thank you (again).

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

Reply | Threaded
Open this post in threaded view
|

Re: starting smartd automatically

Christian Franke
Nuzhna Pomoshch wrote:

> I have (in my very limited time with cygwin) noticed that
> some daemons (sshd, syslog-ng) are run as Windows
> services, and started at boot.
>
> I have installed smartmontools, and see that it has a more
> traditional (linux) installation. The smartd start script is in
> /etc/rc.d/init.d/.
>
> I am wondering if there is some way to start this as soon
> as the machine is booted (even before logging in).

The /etc/rc.d/init.d/smartd script could also be used to install and run
smartd as a Windows service (see also NOTES on smartd man page).

Example:

$ /etc/rc.d/init.d/smartd status
Checking smartd status: not running.

$ /etc/rc.d/init.d/smartd install
Installing service smartd (depending on 'syslog-ng'):
done

$ /etc/rc.d/init.d/smartd status
Checking smartd status: installed as service 'smartd' but not running.

$ /etc/rc.d/init.d/smartd start
Starting service smartd: done

$ /etc/rc.d/init.d/smartd status
Checking smartd status: running as service 'smartd'.

$ /etc/rc.d/init.d/smartd stop
Shutting down smartd: done

$ /etc/rc.d/init.d/smartd status
Checking smartd status: installed as service 'smartd' but not running.

$ /etc/rc.d/init.d/smartd remove
Removing service smartd:
done

$ /etc/rc.d/init.d/smartd status
Checking smartd status: not running.


I would also recommend to change the service start type to "delayed".
Setting this is not yet supported by "cygrunsrv". It could be later set
in service GUI  or with Windows CLI tool "sc".

Example:

$ sc qc smartd
...
         START_TYPE         : 2   AUTO_START
...

$ sc config smartd start= delayed-auto
...

$ sc qc smartd
...
         START_TYPE         : 2   AUTO_START  (DELAYED)
...

Note the crude syntax: The space after "start=" is required.

Hope this helps,
Christian


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple