[CentOS] Running a command at startup

Thu Dec 13 01:25:48 UTC 2018
Robert Moskowitz <rgm at htt-consult.com>


On 12/12/18 7:11 PM, Leroy Tennison wrote:
> Does your version of CentOS have the @reboot crontab option?  If it does this is probably easier unless you want to learn how to write systemd files.

CentOS 7.6.  I will have to google @reboot...

>
>
> Leroy Tennison
> Network Information/Cyber Security Specialist
> E: leroy at datavoiceint.com
> 2220 Bush Dr
> McKinney, Texas
> 75070
> www.datavoiceint.com
> TThis message has been sent on behalf
> of a company that is part of the Harris Operating Group of
> Constellation Software Inc. These companies are listed
> here
> .
> If you prefer not to be contacted by Harris
> Operating Group
> please notify us
> .
> This message is intended exclusively for the
> individual or entity to which it is addressed. This communication
> may contain information that is proprietary, privileged or
> confidential or otherwise legally exempt from disclosure. If you are
> not the named addressee, you are not authorized to read, print,
> retain, copy or disseminate this message or any part of it. If you
> have received this message in error, please notify the sender
> immediately by e-mail and delete all copies of the
> message.
>
> ________________________________________
> From: CentOS <centos-bounces at centos.org> on behalf of Robert Moskowitz <rgm at htt-consult.com>
> Sent: Wednesday, December 12, 2018 6:04 PM
> To: CentOS mailing list
> Subject: [EXTERNAL] [CentOS] Running a command at startup
>
> On a support forum, I was told that to turn off my board's blue led run:
>
> echo none | sudo tee /sys/class/leds/blue\:heartbeat/trigger
>
> Well, this does not survive a system reboot.  So I was told:
>
> Add the off bit to
>
>       /etc/rc.local
>
> Add it above "exit 0"
>
> So of course, CentOS is past using rc.local and recommends:
>
> # It is highly advisable to create own systemd services or udev rules
> # to run scripts during boot instead of using this fi
>
> So can someone point me to how to make this into a simple systemd service?
>
> thanks
>
>
> _______________________________________________
> CentOS mailing list
> CentOS at centos.org
> https://lists.centos.org/mailman/listinfo/centos
> _______________________________________________
> CentOS mailing list
> CentOS at centos.org
> https://lists.centos.org/mailman/listinfo/centos
>