[CentOS] /etc/init.d CentOS 7
James Hogarth
james.hogarth at gmail.com
Fri Sep 26 06:57:41 UTC 2014
On 26 September 2014 07:24, James Hogarth <james.hogarth at gmail.com> wrote:
>
> On 25 Sep 2014 19:39, "Jerry Geis" <geisj at pagestation.com> 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 ;)
More information about the CentOS
mailing list