Running a skript automatically at boot

Spearitch

Member
Joined
Oct 14, 2020
Messages
45
Reaction score
6
Credits
475
Hello Everyone,

Is it possible to run a script automatically with every boot?

There are some command line that I have to enter every time I want to update the date and time and every time I want to connect my device to Wifi.

Thank you
 


Slackware has that facility via rc.local located /etc/rc.d/ its the last thing to be run before login script appears not sure other disrto i will give you an example.


To get apache running for use of web dev i could either do this:
Code:
1)
# chmod a+x /etc/rc.d/rc.httpd
# /etc/rc.d/rc.httpd start

//after second line apache daemon will run boot time
2) or leave chmod permissions of rc.httpd alone and do this:

Code:
put in rc.local

# Start Apache web server:
if [ -x /etc/rc.d/rc.httpd ]; then
  /etc/rc.d/rc.httpd start
fi
//so its a simple if logic ending at fi , if rc.httpd does not have "x" execute permissions i.e it will not automatically start at boot , then kick start it
 
Last edited:
Slackware has that facility via rc.local located /etc/rc.d/ its the last thing to be run before login script appears not sure other disrto i will give you an example.


To get apache running for use of web dev i could either do this:
Code:
1)
# chmod a+x /etc/rc.d/rc.httpd
# /etc/rc.d/rc.httpd start

//after second line apache daemon will run boot time
2) or leave chmod permissions of rc.httpd alone and do this:

Code:
put in rc.local

# Start Apache web server:
if [ -x /etc/rc.d/rc.httpd ]; then
  /etc/rc.d/rc.httpd start
fi
//so its a simple if logic ending at fi , if rc.httpd does not have "x" execute permissions i.e it will not automatically start at boot , then kick start it
I honestly didn't understand what you meant. I am a beginner that's why.

1- Can I write a script let's say "boot_test" and place it in /etc/init.d file so that it will be run when I reboot my system ?

2- Every time I reboot the date is falsely displayed when I used the "date" or "hwclock" commands. How can my system pick up the right date and time while booting?
 

Members online


Top