rc.local not start at the boot

Angelo Moreschini mrangelo.fedora at gmail.com
Fri Oct 31 08:22:57 UTC 2014


Hi Rick,

your suggestion seemed to be the right one ..
But still did not work ...

I made now ​​one further try :
these are the listed files I used

-------------------------[angelo_dev at zorro rc.d]$ cat rc.local---------
#!/bin/bash
/etc/rc.d/dummy-test.sh
/etc/rc.d/syncronize-java_srcs.sh

------------------------[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
/usr/bin/rsync -av \
              --delete \
              --include='*/' \
              --include='*.java' \
              --include='*.form' \
              --exclude='*' \
              /home/programmers/java/PROJECTS_development/ \
              /media/PRTZ-src_sync
==============
1) if I launch rc.local *from the command line* then
   the *file is copied* and *the backup is done*
2) if I *reboot the computer* then
   the *file is copied* *BUT* *the backup is  not done*...



The test proves conclusively that the failure is related to the use of
the rsync
command ...
but can not depend on its path because this time I used the absolute path ..

Need to investigate more about something specific related to the rsync
command

Thank Rick you for your advice







On Fri, Oct 31, 2014 at 2:41 AM, Rick Stevens <ricks at alldigital.com> wrote:

> On 10/29/2014 09:06 PM, Angelo Moreschini issued this missive:
> > Hi Ed,
> >
> > I also thought that I setting controls the command in a different way
> > could be the solution.
> > But it did not was so.
> > The question is now, however, morelimited: it is about understanding why
> > a script that can be run from the command line, does not run inside the
> > file /etc/rc.d/rc.local
>
> Because the /etc/rc.d/rc.local script does not have your login
> environment. The odds are that the path to one or more of your commands
> is missing. If you want to prove this, modify your script to do
> something like
>
>         echo $PATH >/tmp/path.txt
>
> and reboot. Compare the contents of /tmp/path.txt and "echo $PATH" at
> the command line and I'll bet the paths are different.
>
> This is incredibly common for startup scripts and crontab entries. If
> you wish to avoid them, ensure you have a "PATH=" command in the top
> of your script or specify the full path to each command inside the
> script:
>
>         /usr/bin/rsync........
>
> NOT
>
>         rsync.....
>
> because "/usr/bin" may NOT be in the crontab or initscript's PATH.
> ----------------------------------------------------------------------
> - Rick Stevens, Systems Engineer, AllDigital    ricks at alldigital.com -
> - AIM/Skype: therps2        ICQ: 22643734            Yahoo: origrps2 -
> -                                                                    -
> -   After a shooting spree, they always want to take the guns away   -
> -                from the people who didn't do it.                   -
> -                                         -- William S.Burroughs     -
> ----------------------------------------------------------------------
> --
> users mailing list
> users at lists.fedoraproject.org
> To unsubscribe or change subscription options:
> https://admin.fedoraproject.org/mailman/listinfo/users
> Fedora Code of Conduct: http://fedoraproject.org/code-of-conduct
> Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
> Have a question? Ask away: http://ask.fedoraproject.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.fedoraproject.org/pipermail/users/attachments/20141031/d60c5bef/attachment.html>


More information about the users mailing list