> On Oct 15, 2018, at 6:41 PM, Fernando F. <digitaldis...@gmail.com> wrote:
> 
> Team,
> 
> If I want a script to run on startup.
> Do I put it under rc.conf?

First, any changed/added files (minor exceptions) must in the /mnt/kd/ path.
https://doc.astlinux-project.org/userdoc:tt_editable_files

Given that, startup scripts may occur in two places ...

1) /mnt/kd/rc.local
  * Called on startup by service "local" /etc/init.d/local
  * Occurs after all primary services have started.

2) /mnt/kd/rc.elocal
  * Called on startup by service "elocal" /etc/init.d/elocal
  * Occurs immediately after the "network" service has started, but before 
primary services have started.

In either case, they must be shell scripts, for example ...
--
#!/bin/sh

. /etc/rc.conf

mail -r "REBOOT-$HOSTNAME <nore...@example.com>" -s "Rebooted at '$HOSTNAME'" 
m...@example.com <<EOF
Rebooted at '$HOSTNAME'

[Generated at $(date "+%H:%M:%S on %B %d, %Y")]
EOF
--

and must be made executable ...
--
chmod 700 /mnt/kd/rc.local
--

Tip -> you can test such scripts, for example "local" (/mnt/kd/rc.local) with:
--
service local init
--


Lonnie



_______________________________________________
Astlinux-users mailing list
Astlinux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/astlinux-users

Donations to support AstLinux are graciously accepted via PayPal to 
pay...@krisk.org.

Reply via email to