public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Christian Franke <Christian.Franke@t-online.de>
To: cygwin@cygwin.com
Subject: Re: starting smartd automatically
Date: Tue, 29 May 2018 11:47:00 -0000	[thread overview]
Message-ID: <e52e531e-f404-43b8-2b33-8c1572cd53c4@t-online.de> (raw)
In-Reply-To: <287027090.6029735.1527517102603@mail.yahoo.com>

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

WARNING: multiple messages have this Message-ID
From: Christian Franke <Christian.Franke@t-online.de>
To: cygwin@cygwin.com
Subject: Re: starting smartd automatically
Date: Tue, 29 May 2018 17:32:00 -0000	[thread overview]
Message-ID: <e52e531e-f404-43b8-2b33-8c1572cd53c4@t-online.de> (raw)
Message-ID: <20180529173200.BH7pdUrcl8FUFo6zA2wv1nyaMUQ65QaZFLiFPd2dLEA@z> (raw)
In-Reply-To: <287027090.6029735.1527517102603@mail.yahoo.com>

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

  reply	other threads:[~2018-05-29 11:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <287027090.6029735.1527517102603.ref@mail.yahoo.com>
2018-05-29  1:04 ` Nuzhna Pomoshch via cygwin
2018-05-29 11:47   ` Christian Franke [this message]
2018-05-29 17:32     ` Christian Franke

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e52e531e-f404-43b8-2b33-8c1572cd53c4@t-online.de \
    --to=christian.franke@t-online.de \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).