rc.local not start at the boot

Ed Greshko ed.greshko at greshko.com
Wed Oct 29 12:09:34 UTC 2014


On 10/29/14 19:08, Angelo Moreschini wrote:
> Hi,
>
> I did some tests:
>
> This is the content of the file /etc/rc.d/rc.local that I used:
> ------------------------------
> #!/bin/bash
> # this is the file /ctc/rc./rc.local
>
> /etc/rc.d/dummy-test.sh
> /etc/rc.d/syncronize-java_srcs.sh
> ------------------------------
>
> I put inside it two script to be executed:
>
> /etc/rc.d/dummy-test.sh                   (to make a simple copy of a file)
> /etc/rc.d/syncronize-java_srcs.sh      (to make backups ..)
>
> -----------------------------------
> [angelo_dev at zorro rc.d]$ cat dummy-test.sh
> #!/bin/bash
> cp /home/angelo_dev/Documents/dconf-Editor.xcf /media/PRTZ-src_sync
> ---------------------------------
>
> ---------------------------------
> [angelo_dev at zorro rc.d]$ cat syncronize-java_srcs.sh
> #!/bin/bash
> # this is the file /home/angelo_dev/bin/syncronize-java_srcs.sh
>
>
> rsync -av --delete --include='*/' --include='*.java' --include='*.form' --exclude='*' \
>                             /home/programmers/java/PROJECTS_development/ \
>                             /media/PRTZ-src_sync
> ---------------------------
>
> the scripts are both in the same directory... ( the same directory than rc.local)
>
> NOW :
> doing the reboot, only the first script is executed
> NOT the second one
>
> So I have the _copy_ of the file (for test) _but not the backup.
> _
> how it can be interpreted that fact ?

The second script *IS* getting executed.  But, for some reason, it is failing.  I don't know how many times that can be repeated.

Change that script to this....

---------------------------
[egreshko at meimei ~]$ cat syncronize-java_srcs.sh
#!/bin/bash
# this is the file /home/angelo_dev/bin/syncronize-java_srcs.sh
exec 2> /tmp/syncronize.log      # send stderr from rc.local to a log file
exec 1>&2                        # send stdout to the same log file
set -x                           # tell sh to display commands before execution


rsync -av --delete --include='*/' --include='*.java' --include='*.form' --exclude='*' \
                            /home/programmers/java/PROJECTS_development/ \
                            /media/PRTZ-src_sync
--------------------------

Reboot and supply the contents of /tmp/syncronize.log


-- 
If you can't laugh at yourself, others will gladly oblige.



More information about the users mailing list