'cobbler sync' fails when run in a bash script after 'service cobbler restart'

Bug #888266 reported by Armens Movsesjans
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
cobbler (Ubuntu)
Invalid
Medium
Unassigned

Bug Description

1. Ubuntu
$ lsb_release -rd
Description: Ubuntu 11.10
Release: 11.10

2. Cobbler
$ apt-cache policy cobbler
cobbler:
  Installed: 2.1.0+git20110602-0ubuntu26
  Candidate: 2.1.0+git20110602-0ubuntu26
  Version table:
 *** 2.1.0+git20110602-0ubuntu26 0
        500 http://fi.archive.ubuntu.com/ubuntu/ oneiric/universe i386 Packages
        100 /var/lib/dpkg/status

3. and 4. Description

After making changes to cobbler configuration, my simple bash script fails restarting the cobbler service and syncing the configuration, i.e. having the two commands in the script running one after another like this:

sudo service cobbler restart
sudo cobbler sync

produces following output: "cobblerd does not appear to be running/accessible", although if same commands are run manually in the terminal, one after another - all is working well, i.e. 'cobbler-sync' successfully ends up with "*** TASK COMPLETE ***"

The workaround that I found is to insert a short timeout [even one second is enough] in between the two commands:

sudo service cobbler restart
sleep 1
sudo cobbler sync

which produces the same output as when restarting and syncing the configuration manually.

My hypothesis is that in the moment when 'sudo cobbler sync' is run the cobbler service has not yet been completely restarted and, hence, the service is not [yet] running/accessible.

I have tested it on several 32-bit Ubuntu Natty/Oneric machines, and all tests have produced the same result. The most atomic test I came up with is to run a script with only the two above mentioned commands which should fail:

sudo service cobbler restart
sudo cobbler sync

And same script with a timeout in between, which should succeed:

sudo service cobbler restart
sleep 1
sudo cobbler sync

I dont know whether this bug is in cobbler or in the way ubuntu performs restart of cobbler service.

A short description of the circumstances I found this bug and a link to the actual bash script, if needed, can be found on my group's project blog post http://awaseconfigurations.wordpress.com/2011/10/28/cobbler-setup-script-problem-with-restarting-service-and-rebuilding-configuration/

ProblemType: Bug
DistroRelease: Ubuntu 11.10
Package: cobbler 2.1.0+git20110602-0ubuntu26
ProcVersionSignature: Ubuntu 3.0.0-12.20-generic 3.0.4
Uname: Linux 3.0.0-12-generic i686
ApportVersion: 1.23-0ubuntu3
Architecture: i386
Date: Wed Nov 9 21:25:29 2011
InstallationMedia: Ubuntu 11.10 "Oneiric Ocelot" - Release i386 (20111012)
PackageArchitecture: all
ProcEnviron:
 PATH=(custom, no user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: cobbler
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Armens Movsesjans (movsesjans) wrote :
affects: ubuntu → cobbler (Ubuntu)
Dave Walker (davewalker)
Changed in cobbler (Ubuntu):
importance: Undecided → Medium
Revision history for this message
Nish Aravamudan (nacc) wrote :

I don't believe this is still present in 16.10. Please reopen if so.

Changed in cobbler (Ubuntu):
status: New → Incomplete
status: Incomplete → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.