Scientific Linux Forum.org



  Reply to this topicStart new topicStart Poll

> /etc/rc.local is not executed
igadoter
 Posted: Jul 13 2015, 04:50 PM
Quote Post


SLF Member
***

Group: Members
Posts: 54
Member No.: 3337
Joined: 13-January 15









Hi,

I put some simple command into /etc/rc.local, but it seems for me these commands
are not being executed during system boot. How can I verify this? System is
starting in runlevel 3 (SysV Init). I am running SL 6.4

I read that all contains of /etc/rc.local is executed as last step during startup.
PMEmail Poster
^
burakkucat
 Posted: Jul 13 2015, 07:37 PM
Quote Post


SLF Administrator
****

Group: Admins
Posts: 205
Member No.: 14
Joined: 10-April 11









Who owns and what is the mode of your /etc/rc.d/rc.local file?

This is how it is configured on my system --

CODE

[Duo2 ~]$ ls -l /etc/rc.d/rc.local
-rwxr-xr-x. 1 root root 626 Apr  9 12:52 /etc/rc.d/rc.local
[Duo2 ~]$ cat /etc/rc.d/rc.local
#!/bin/sh
#
# /etc/rc.d/rc.local
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.

if [ ! -f /var/lock/subsys/local ]; then
       # Set the lock file.
       /bin/touch /var/lock/subsys/local

       # If the system has been running in single user mode
       # the files /.bash_history, /.lesshst and /.viminfo
       # may have been created. If they exist, delete them.
       for F in /.bash_history /.lesshst /.viminfo
       do
               [ -f $F ] && rm -f $F
       done

       # Expire the yum cache.
       yum clean expire-cache >/dev/null 2>&1 &
fi
[Duo2 ~]$

--------------------
user posted image 100% Linux and, previously, Unix. Co-founder of the ELRepo Project.
PMUsers Website
^
igadoter
 Posted: Jul 14 2015, 10:15 AM
Quote Post


SLF Member
***

Group: Members
Posts: 54
Member No.: 3337
Joined: 13-January 15









Here is my /etc/rc.local
CODE

[piotr@druid ~]$ ll -L /etc/rc.local
-rwxr-xr-x. 1 root root 347 07-07 02:02 /etc/rc.local
[piotr@druid ~]$ cat /etc/rc.local
#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.

touch /var/lock/subsys/local
ifconfig eth0 192.168.1.101
ifconfig eth0 up

# Setting default brightness
echo 5 > /sys/class/backlight/acpi_vide0/brightness
[piotr@druid ~]$

but at least the last command from this script is not executed, when I am logging brightness is set to its maximal value, so I have to yet again execute this command, with su -c.

Sorry, but I just at this moment have checked network interfaces setting. It seems that both 'ifconfig' are actually executed. The issue is only with the last command in that script.
PMEmail Poster
^
burakkucat
 Posted: Jul 14 2015, 03:06 PM
Quote Post


SLF Administrator
****

Group: Admins
Posts: 205
Member No.: 14
Joined: 10-April 11









It took me while to notice it . . .

echo 5 > /sys/class/backlight/acpi_vide0/brightness

I think you have a typo in that command line. wink.gif

--------------------
user posted image 100% Linux and, previously, Unix. Co-founder of the ELRepo Project.
PMUsers Website
^
igadoter
 Posted: Jul 14 2015, 03:45 PM
Quote Post


SLF Member
***

Group: Members
Posts: 54
Member No.: 3337
Joined: 13-January 15









QUOTE (burakkucat @ Jul 14 2015, 05:06 PM)
It took me while to notice it . . .

echo 5 > /sys/class/backlight/acpi_vide0/brightness

I think you have a typo in that command line.  wink.gif


Oh, men! I feel so ashamed! Of course you right! But I verfied this several times!

Many thanks! You saved me!
PMEmail Poster
^
burakkucat
 Posted: Jul 14 2015, 05:16 PM
Quote Post


SLF Administrator
****

Group: Admins
Posts: 205
Member No.: 14
Joined: 10-April 11









QUOTE (igadoter @ Jul 14 2015, 03:45 PM)

Oh, men! I feel so ashamed! Of course you right! But I verfied this several times!

Many thanks! You saved me!

You're welcome. smile.gif

Please don't worry about it. We've all done something similar at some time in the past . . .

--------------------
user posted image 100% Linux and, previously, Unix. Co-founder of the ELRepo Project.
PMUsers Website
^
John Cuppi
 Posted: Aug 4 2015, 03:47 PM
Quote Post


SLF Admin Team
***

Group: Admins
Posts: 144
Member No.: 15
Joined: 10-April 11









Over the years I have learned a good way of always checking to see if something is executing or not is to add a command "so basic" that it will run for sure, or at least provide an error back. My favorite is something just like "touch whatever.txt" - this is usually enough to rule whether or not a script is actually executing or not.
PMUsers Website
^
0 User(s) are reading this topic (0 Guests and 0 Anonymous Users)
0 Members:

Topic Options Reply to this topicStart new topicStart Poll