Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Systemd: gandi-postboot startup error #5

Open
alorence opened this issue Mar 22, 2017 · 5 comments
Open

Systemd: gandi-postboot startup error #5

alorence opened this issue Mar 22, 2017 · 5 comments

Comments

@alorence
Copy link

alorence commented Mar 22, 2017

Hi,

Currently, gandi-postboot init script run /usr/bin/python2 /gandi/init at startup (or /usr/bin/python if python2 doesn't exists).
On my server, the script /gandi/init contains exactly this code:

#!/bin/sh

echo "I'm a useless script most of the times"

Obviously, it's a Shell script, so its execution by Python interpreter is not possible. As a result, the systemd unit "gandi-postboot" don't run and the service remains in "failed" state:

# systemctl status gandi-postboot.service
● gandi-postboot.service - Gandi-postboot start customer setup script
   Loaded: loaded (/usr/share/gandi/systemd/gandi-postboot.service; enabled)
   Active: failed (Result: exit-code) since mer. 2017-03-22 15:27:39 CET; 1h 30min ago
  Process: 11950 ExecStart=/etc/init.d/gandi-postboot start (code=exited, status=1/FAILURE)
 Main PID: 11950 (code=exited, status=1/FAILURE)

mars 22 15:27:39 myserver.tld systemd[1]: Starting Gandi-postboot start customer setup script...
mars 22 15:27:39 myserver.tld systemd[1]: Started Gandi-postboot start customer setup script.
mars 22 15:27:39 myserver.tld gandi-postboot[11950]: File "/gandi/init", line 3
mars 22 15:27:39 myserver.tld gandi-postboot[11950]: echo "I'm a useless script most of the times"
mars 22 15:27:39 myserver.tld gandi-postboot[11950]: ^
mars 22 15:27:39 myserver.tld gandi-postboot[11950]: SyntaxError: invalid syntax
mars 22 15:27:39 myserver.tld systemd[1]: gandi-postboot.service: main process exited, code=exited, status=1/FAILURE
mars 22 15:27:39 myserver.tld systemd[1]: Unit gandi-postboot.service entered failed state.

I'm on Debian 8 with kernel 3.12.70:

# cat /proc/version
Linux version 3.12.70-guest-46-ff21902-x86_64 ([email protected]) (gcc version 4.9.2 (Debian 4.9.2-10) ) #2 SMP Fri Feb 24 16:32:41 UTC 2017

Gandi-hosting-vm2 is installed, version 2.6

# dpkg -l | grep gandi
ii  gandi-hosting-vm2              2.6                        all          scripts for virtual machine on Gandi IaaS
@kalou
Copy link
Contributor

kalou commented Mar 22, 2017

Hi,
Thanks!

The "useless" script is the default we use when we did not provision an init script on the node. Were you testing this on our new datacenter ?

Also, the postboot script should not assume it'll be provided with a python script, we should probably fix that.

@alorence
Copy link
Author

alorence commented Mar 22, 2017

Hello !

The server with these scripts has been created 2 or 3 years ago and is located at Bissen. I assume it uses the GandiV4 platform.

@ctrlaltca
Copy link

While debugging #6, i noticed this same problem:

Jun 12 18:16:43 centos7 gandi-postboot[2322]: File "/gandi/init", line 3
Jun 12 18:16:43 centos7 gandi-postboot[2322]: echo "I'm a useless script most of the times"
Jun 12 18:16:43 centos7 gandi-postboot[2322]: ^
Jun 12 18:16:43 centos7 gandi-postboot[2322]: SyntaxError: invalid syntax
Jun 12 18:16:43 centos7 systemd[1]: gandi-postboot.service: main process exited, code=exited, status=1/FAILURE
Jun 12 18:16:43 centos7 systemd[1]: Failed to start Gandi-postboot start customer setup script.
Jun 12 18:16:43 centos7 systemd[1]: Unit gandi-postboot.service entered failed state.
Jun 12 18:16:43 centos7 systemd[1]: gandi-postboot.service failed.

@stephen-smith
Copy link

Still seeing this problem any my Debian 9 system.

Also seems to affect bootstrap.d/01-config_swap which also assumes /gandi/init is a python script if it is executable.

@b3
Copy link

b3 commented Jan 3, 2023

Still seeing the same problem on my Debian 11 system.

root@auckland:~# dpkg --list | grep gandi
ii  gandi-hosting-vm2                     2.41                                  all          scripts for virtual machine on Gandi IaaS

BTW I get a lot of other errors (notably on /etc/udev/rules.d/86-gandi.rules):

root@auckland:~# journalctl -b -0 | grep gandi
Jan 03 09:21:47 auckland systemd[1]: /usr/share/gandi/systemd/gandi-postboot.service:15: Support for option SysVStartPriority= has been removed and it is ignored
Jan 03 09:21:47 auckland systemd-udevd[494]: /etc/udev/rules.d/86-gandi.rules:14 Invalid value for OPTIONS key, ignoring: 'last_rule'
Jan 03 09:21:47 auckland systemd-udevd[494]: /etc/udev/rules.d/86-gandi.rules:15 Invalid value for OPTIONS key, ignoring: 'last_rule'
Jan 03 09:21:47 auckland systemd-udevd[494]: /etc/udev/rules.d/86-gandi.rules:16 Invalid value for OPTIONS key, ignoring: 'ignore_device'
Jan 03 09:21:47 auckland systemd-udevd[494]: /etc/udev/rules.d/86-gandi.rules:16 The line takes no effect, ignoring.
Jan 03 09:21:47 auckland systemd-udevd[494]: /etc/udev/rules.d/86-gandi.rules:22 Invalid value for OPTIONS key, ignoring: 'last_rule'
Jan 03 09:21:47 auckland systemd-udevd[494]: /etc/udev/rules.d/86-gandi.rules:32 Invalid value for OPTIONS key, ignoring: 'last_rule'
Jan 03 09:21:48 auckland gandi[562]: /dev/xvda1 / sys-auckland is now available
Jan 03 09:21:48 auckland gandi[560]: /dev/xvdd / donnees03 is now available
Jan 03 09:21:48 auckland gandi[564]: /dev/xvdb / donnees02 is now available
Jan 03 09:21:48 auckland gandi[558]: /dev/xvda2 / is now available
Jan 03 09:21:49 auckland gandi[650]: 
Jan 03 09:21:49 auckland gandi[654]: 
Jan 03 09:21:50 auckland gandi[712]: Cannot find tarball and info in the swap space. Continue formatting.
Jan 03 09:21:50 auckland gandi-bootstrap[688]: Cannot find tarball and info in the swap space. Continue formatting.
Jan 03 09:21:51 auckland gandi[822]: 
Jan 03 09:21:51 auckland gandi[856]: 01-config_swap executed correctly.
Jan 03 09:21:51 auckland gandi[863]: 02-config_sysctl executed correctly.
Jan 03 09:21:51 auckland gandi[870]: resize2fs 1.46.2 (28-Feb-2021)
Jan 03 09:21:51 auckland gandi[870]: The filesystem is already 2621440 (4k) blocks long.  Nothing to do!
Jan 03 09:21:51 auckland gandi[870]: 
Jan 03 09:21:51 auckland gandi[874]: 03-resize_main_disk executed correctly.
Jan 03 09:21:51 auckland systemd[1]: gandi-bootstrap.service: Succeeded.
Jan 03 09:21:51 auckland gandi[881]: 
Jan 03 09:21:52 auckland gandi[908]: 01-config_console executed correctly.
Jan 03 09:21:52 auckland gandi-config[913]: awk: cmd. line:1: warning: escape sequence `\s' treated as plain `s'
Jan 03 09:21:52 auckland gandi[919]: 02-config_system_file executed correctly.
Jan 03 09:21:52 auckland gandi[932]: 03-vm-fix-cron executed correctly.
Jan 03 09:21:52 auckland gandi[941]: 07-config_timezone executed correctly.
Jan 03 09:21:52 auckland gandi[949]: 11-config_ssh executed correctly.
Jan 03 09:21:52 auckland gandi[958]: 13-config_motd executed correctly.
Jan 03 09:21:52 auckland gandi[977]: 16-vm-fix-ext3 executed correctly.
Jan 03 09:21:52 auckland systemd[1]: gandi-config.service: Succeeded.
Jan 03 09:21:52 auckland gandi[1006]: 
Jan 03 09:21:52 auckland gandi[1011]: 
Jan 03 09:21:52 auckland gandi[1013]: 
Jan 03 09:21:52 auckland gandi[1021]: 
Jan 03 09:21:52 auckland gandi-mount[980]: Starting gandi-mount: ok.
Jan 03 09:21:52 auckland systemd[1]: gandi-mount.service: Succeeded.
Jan 03 09:21:53 auckland gandi-postboot[1014]:   File "/gandi/init", line 3
Jan 03 09:21:53 auckland gandi-postboot[1014]:     echo "I'm a useless script most of the times"
Jan 03 09:21:53 auckland gandi-postboot[1014]:                                                 ^
Jan 03 09:21:53 auckland gandi-postboot[1014]: SyntaxError: invalid syntax
Jan 03 09:21:53 auckland systemd[1]: gandi-postboot.service: Main process exited, code=exited, status=1/FAILURE
Jan 03 09:21:53 auckland systemd[1]: gandi-postboot.service: Failed with result 'exit-code'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants