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:Nzpsvk8...
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
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
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@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@lemo.dk http://www.lemo.dk
CentOS mailing list CentOS@centos.org https://lists.centos.org/mailman/listinfo/centos
Found this after using debug-level. Seems as if curl doesn t use the proxy configuration. We are using port 8080.
} } 2019-01-14 09:57:06,919 attempt 1/10: http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infr... 2019-01-14 09:57:35,048 exception: [Errno 14] curl#7 - "Failed connect to mirrorlist.centos.org:80; Die Operation ist jetzt in Bearbeitung" 2019-01-14 09:57:35,049 retrycode (14) not in list [-1, 2, 4, 5, 6, 7], re-raising ~
Zitat von Ralf Prengel ralf.prengel@rprengel.de:
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@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@lemo.dk http://www.lemo.dk
CentOS mailing list CentOS@centos.org https://lists.centos.org/mailman/listinfo/centos
CentOS mailing list CentOS@centos.org https://lists.centos.org/mailman/listinfo/centos
Zitat von Mogens Kjaer mk@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
On 14/1/19 5:26 pm, Ralf Prengel wrote:
Hallo,
yes it is up. Result of 10 pings is fine as first line in the script. Any other ideas?
Ralf
Maybe there's something in the install process that needs a tty - maybe try running it in a screen session???
On 16/1/19 1:48 am, Anthony K wrote:
On 14/1/19 5:26 pm, Ralf Prengel wrote:
Hallo,
yes it is up. Result of 10 pings is fine as first line in the script. Any other ideas?
Ralf
Maybe there's something in the install process that needs a tty - maybe try running it in a screen session???
Sorry, ignore me - didn't see you had it sorted in a another out-of-band response...