Ralf Prengel
2019-Jan-10 10:32 UTC
[CentOS] @reboot only some lines of a script are working (yum install not)
Hallo, I m using a script to install docker after a reboot. The script is starting and working. The problem: yum install doesn't work running the script via cron allthough yum remove works. Starting the script manual works fine . Has anyone a hint for me? Thanks Ralf xxx SHELL=/bin/bash PATH=/sbin:/bin:/usr/sbin:/usr/bin MAILTO=root # For details see man 4 crontabs # Example of job definition: # .---------------- minute (0 - 59) # | .------------- hour (0 - 23) # | | .---------- day of month (1 - 31) # | | | .------- month (1 - 12) OR jan,feb,mar,apr ... # | | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat # | | | | | # * * * * * user-name command to be executed @reboot root /opt/install_via_pxe/centos_autoinstall/stage01/init_stage01_docker.sh xxx #! /bin/bash echo 'script init_stage01_docker.sh ist gestartet' >> /var/log/comline/autoinst.log /usr/bin/yum install -y cifs-utils systemctl stop packagekit.service systemctl disable packagekit.service yum remove PackageKit -y /usr/bin/yum install -y docker mv /var/lib/docker /mnt/platte02 cd /var/lib ln -s /mnt/platte02/docker docker cp /opt/install_via_pxe/centos_autoinstall/stage01/docker/daemon.json /etc/docker systemctl enable docker systemctl start docker docker run --rm --privileged -v /var/run/docker.sock:/var/run/docker.sock -v /var/lib/rancher:/var/lib/rancher rancher/agent:v1.2.10 http://192.168.242.x.y/v1/scripts/811F51C097F763ABA2E5:1546214400000:Nzpsvk8sbaKXle3QYotSNzUFk cp -r /opt/install_via_pxe/centos_autoinstall/stage02/etc/crontab /etc/ echo 'script init_stage01_docker.sh ist gelaufen' >> /var/log/comline/autoinst.log shutdown -r now xxx
Mogens Kjaer
2019-Jan-10 17:23 UTC
[CentOS] @reboot only some lines of a script are working (yum install not)
On 1/10/19 11:32 AM, Ralf Prengel wrote:> yum install doesn't work running the script via cron allthough yum > remove works.Is the network up when the script executes? Mogens -- Mogens Kjaer, mk at lemo.dk http://www.lemo.dk
Ralf Prengel
2019-Jan-10 17:52 UTC
[CentOS] @reboot only some lines of a script are working (yum install not)
ok a good hint. I will test it monday. Ralf Von meinem iPhone gesendet> Am 10.01.2019 um 18:23 schrieb Mogens Kjaer <mk at lemo.dk>: > >> On 1/10/19 11:32 AM, Ralf Prengel wrote: >> yum install doesn't work running the script via cron allthough yum remove works. > > Is the network up when the script executes? > > Mogens > > -- > Mogens Kjaer, mk at lemo.dk > http://www.lemo.dk > > _______________________________________________ > CentOS mailing list > CentOS at centos.org > https://lists.centos.org/mailman/listinfo/centos
Ralf Prengel
2019-Jan-14 06:26 UTC
[CentOS] @reboot only some lines of a script are working (yum install not)
Zitat von Mogens Kjaer <mk at lemo.dk>:> On 1/10/19 11:32 AM, Ralf Prengel wrote: >> yum install doesn't work running the script via cron allthough yum >> remove works. > > Is the network up when the script executes?Hallo, yes it is up. Result of 10 pings is fine as first line in the script. Any other ideas? Ralf
Possibly Parallel Threads
- @reboot only some lines of a script are working (yum install not)
- @reboot only some lines of a script are working (yum install not)
- @reboot only some lines of a script are working (yum install not)
- @reboot only some lines of a script are working (yum install not)
- Badlock bad luck