LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware > Slackware - ARM
User Name
Password
Slackware - ARM This forum is for the discussion of Slackware ARM.

Notices


Reply
  Search this Thread
Old 01-05-2017, 11:43 AM   #1
Reedych
Member
 
Registered: Jul 2016
Location: Earth
Distribution: Slackware64 14.2
Posts: 37

Rep: Reputation: Disabled
/etc/rc.d/rc.local doesn't execute at start


I use slackware arm current. It contains only ntpdate. I gave a execupermission him:
Code:
-rwxr-xr-x  1 root root  377 Nov 27 14:43 rc.local
 
Old 01-05-2017, 12:29 PM   #2
Exaga
Member
 
Registered: Nov 2012
Distribution: Slackware Linux
Posts: 77

Rep: Reputation: 50
Quote:
Originally Posted by Reedych View Post
I use slackware arm current. It contains only ntpdate. I gave a execupermission him:
Code:
-rwxr-xr-x  1 root root  377 Nov 27 14:43 rc.local
Can you run rc.local from the command prompt?

Code:
root@slackwarearm:~# /etc/rc.d/rc.local
 
Old 01-05-2017, 12:35 PM   #3
Reedych
Member
 
Registered: Jul 2016
Location: Earth
Distribution: Slackware64 14.2
Posts: 37

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Exaga View Post
Can you run rc.local from the command prompt?

Code:
root@slackwarearm:~# /etc/rc.d/rc.local
yes, I need to do it everyreboot
 
Old 01-05-2017, 01:34 PM   #4
drmozes
Slackware Contributor
 
Registered: Apr 2008
Location: Surrey, England
Distribution: Slackware
Posts: 537

Rep: Reputation: 399Reputation: 399Reputation: 399Reputation: 399
Quote:
Originally Posted by Reedych View Post
yes, I need to do it everyreboot
Show us the output of
Code:
cat /etc/rc.d/rc.local
Also does your system get to the login prompt on the console?
 
Old 01-05-2017, 01:44 PM   #5
Reedych
Member
 
Registered: Jul 2016
Location: Earth
Distribution: Slackware64 14.2
Posts: 37

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by drmozes View Post
Show us the output of
Code:
cat /etc/rc.d/rc.local
Also does your system get to the login prompt on the console?
Code:
#!/bin/sh -e
#
# /etc/rc.d/rc.local:  Local system initialization script.
#
# Put any local startup commands in here.  Also, if you have
# anything that needs to be run at shutdown time you can
# make an /etc/rc.d/rc.local_shutdown script and put those
# commands in there.


# set system date/time at boot from ntp server [rpi3-hacks-3.0]
ntpdate 0.pool.ntp.org > /dev/null &
I login using ssh.
 
Old 01-05-2017, 01:48 PM   #6
BW-userx
Senior Member
 
Registered: Sep 2013
Location: MID-SOUTH USA
Distribution: Void Linux / Slackware 14.2
Posts: 4,635

Rep: Reputation: 857Reputation: 857Reputation: 857Reputation: 857Reputation: 857Reputation: 857Reputation: 857
Quote:
Originally Posted by Reedych View Post
Code:
#!/bin/sh -e
#
# /etc/rc.d/rc.local:  Local system initialization script.
#
# Put any local startup commands in here.  Also, if you have
# anything that needs to be run at shutdown time you can
# make an /etc/rc.d/rc.local_shutdown script and put those
# commands in there.


# set system date/time at boot from ntp server [rpi3-hacks-3.0]
ntpdate 0.pool.ntp.org > /dev/null &
I login using ssh.
run that off you command line without sending it to NULL to be sure that it works, you may be missing a PATH
 
Old 01-06-2017, 01:58 PM   #7
Penthux
Member
 
Registered: Dec 2008
Location: Middlesbrough, UK
Distribution: Slackware
Posts: 142

Rep: Reputation: 35
Quote:
Originally Posted by Reedych View Post
Code:
# set system date/time at boot from ntp server [rpi3-hacks-3.0]
ntpdate 0.pool.ntp.org > /dev/null &
I login using ssh.
In addition to BW-userx's advice, use a full path when troubleshooting command issues. Sometimes it makes all the difference.

Code:
root@slackarmbox:~# /usr/sbin/ntpdate 0.pool.ntp.org 
 6 Jan 20:56:16 ntpdate[33229]: adjust time server 163.172.216.210 offset 0.000318 sec
You can also check your PATH with:

Code:
root@slackarmbox:~# echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
 
1 members found this post helpful.
Old 01-07-2017, 12:44 AM   #8
Reedych
Member
 
Registered: Jul 2016
Location: Earth
Distribution: Slackware64 14.2
Posts: 37

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Penthux View Post
In addition to BW-userx's advice, use a full path when troubleshooting command issues. Sometimes it makes all the difference.

Code:
root@slackarmbox:~# /usr/sbin/ntpdate 0.pool.ntp.org 
 6 Jan 20:56:16 ntpdate[33229]: adjust time server 163.172.216.210 offset 0.000318 sec
You can also check your PATH with:

Code:
root@slackarmbox:~# echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
Added /usr/sbin to ntpdate, thanks!
 
Old 01-07-2017, 12:45 AM   #9
Reedych
Member
 
Registered: Jul 2016
Location: Earth
Distribution: Slackware64 14.2
Posts: 37

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by BW-userx View Post
run that off you command line without sending it to NULL to be sure that it works, you may be missing a PATH
/usr/sbin/ was needed to add to ntpdate, but thanks!
 
Old 01-07-2017, 07:06 AM   #10
BW-userx
Senior Member
 
Registered: Sep 2013
Location: MID-SOUTH USA
Distribution: Void Linux / Slackware 14.2
Posts: 4,635

Rep: Reputation: 857Reputation: 857Reputation: 857Reputation: 857Reputation: 857Reputation: 857Reputation: 857
Quote:
Originally Posted by Reedych View Post
/usr/sbin/ was needed to add to ntpdate, but thanks!
this is why it is good to always check it in the command line if it isn't working to see the feedback in the terminal. Then you can go into troubleshooting mode from there.
 
Old 01-12-2017, 04:19 PM   #11
SCerovec
Senior Member
 
Registered: Oct 2006
Location: Cp6uja
Distribution: Slackware on x86 and arm
Posts: 1,101
Blog Entries: 2

Rep: Reputation: 132Reputation: 132
Usually it suffices to comment out the >/dev/null
Code:
ntpdate 0.pool.ntp.org # > /dev/null &
and get the error even on the boot (if any screen attached)
 
Old 01-26-2017, 02:01 PM   #12
gus3
Member
 
Registered: Jun 2014
Distribution: Slackware (x86 and ARM)
Posts: 78

Rep: Reputation: Disabled
Using full pathnames in boot scripts is always a good idea, as a safeguard against a rogue PATH to compromised binaries.

As for running this script from the command line, one way to watch the execution without modifying the script is to use:

Code:
# sh -vx /etc/rc.d/rc.local
and you can see each line as it is executed.
 
2 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
shell can't execute through ssh but local well wanghao Programming 1 01-10-2010 11:11 PM
rc.local doesn't execute my line, but it runs from root Kreshna Linux - Software 9 11-30-2009 01:59 AM
re-execute rc.local file only shoaibahmedkhan Red Hat 4 12-30-2008 01:55 AM
re-execute rc.local file only shoaibahmedkhan Linux - Newbie 1 12-30-2008 01:17 AM
Without rc.local how I execute commands on boot dyool Ubuntu 2 09-30-2006 01:47 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware > Slackware - ARM

All times are GMT -5. The time now is 08:55 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration