Re: /etc/init.d CentOS 7

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



On 26 September 2014 07:24, James Hogarth <james.hogarth@xxxxxxxxx> wrote:

>
> On 25 Sep 2014 19:39, "Jerry Geis" <geisj@xxxxxxxxxxxxxxx> wrote:
> >
> > I used to use rc.local and just need a script to run AFTER everything
> else
> > has ran.
> > no special start/stop/reload is needed... just a simple script.
> >
>
> 1) you can still use /etc/rc.d/rc.local
> 2) read the systemd.service man page and do a little learning. Thus is the
> exact sort of scenario systemd units make trivial with very simple config
> compared to writing a sysvinit script
>
To give an example of the systemd bit should you wish to try a unit file:

cat > /etc/systemd/system/speciallittlesnowflake.service <<EOF
[Unit]
Description=This unit describes starting my special little snowflake and
needs a network
After=network-online.target

[Service]
Type=forking
ExecStart=/usr/local/bin/speciallittlesnowflake.sh
TimeoutSec=0
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target
EOF

systemctl daemon-reload
systemctl enable myspeciallittlesnowflake

Adapt as needed ;)
_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos




[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux