How to 'debug' boot problems

General support questions
Post Reply
jallmer
Posts: 2
Joined: 2015/07/24 20:07:51

How to 'debug' boot problems

Post by jallmer » 2015/07/24 20:28:40

Hi,

I found a script to create a service for virtualbox on Ubuntu and it works find there.
On Centos I put the script into /etc/init.d and added the missing chkconfig header information (chkconfig: 235 99 01)
When running the script directly, it works.
I added the service via chkconfig --add ... on
Then I reboot the server.

What I would want is the service to be accessible (in this case it is virtualbox and I would want to SSH to it which works fine when I start the service by hand).
Unfortunately, the service is not started during the boot process.
dmesg didn't reveal any information on the service.

Where can I look to find out what is going wrong?
Where else can I start a service once everything else has been started?

Thank you.

lightman47
Posts: 1522
Joined: 2014/05/21 20:16:00
Location: Central New York, USA

Re: How to 'debug' boot problems

Post by lightman47 » 2015/07/24 21:23:29

instead of "chkconfig --add" try

systemctl enable {servicename}

CentOS 7 is different

jallmer
Posts: 2
Joined: 2015/07/24 20:07:51

Re: How to 'debug' boot problems

Post by jallmer » 2015/07/25 07:20:19

So I tried to find a script to use systemctl:
http://unix.stackexchange.com/questions ... hine-hangs

I put that into init.d, made it executable, etc.

Now the command:
sudo systemctl start StartVM-S1.service
returns:
Failed to issue method call: Unit StartVM-S1.service failed to load: No such file or directory.
The file is actually there and not a symlink.
using enable instead of start produces:
Failed to issue method call: Access denied.
Also used dos2unix ... but no change.

Any ideas?

The script:

Code: Select all

[Unit]
Description=Virtualbox Headless VM
Wants=network-online.target
After=network-online.target

[Service]
Type=simple
ExecStart=/usr/bin/VBoxHeadless -s jLabVMS1
ExecStop=/usr/bin/VBoxManage controlvm jLabVMS1 poweroff
User=bionia

[Install]
WantedBy=multi-user.target

lightman47
Posts: 1522
Joined: 2014/05/21 20:16:00
Location: Central New York, USA

Re: How to 'debug' boot problems

Post by lightman47 » 2015/07/25 10:49:13

I used a virtualbox.repo file and yum to install mine on Centos7 and didn't have to do all of that. Admittedly I am not starting an actual session at boot, but the service starts auto.

/etc/yum.repos.d/virtualbox.repo:

Code: Select all

[virtualbox]
name=Oracle Linux / RHEL / CentOS-$releasever / $basearch - VirtualBox
baseurl=http://download.virtualbox.org/virtualbox/rpm/el/$releasever/$basearch
enabled=1
gpgcheck=1
gpgkey=https://www.virtualbox.org/download/oracle_vbox.asc

User avatar
TrevorH
Site Admin
Posts: 33219
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: How to 'debug' boot problems

Post by TrevorH » 2015/07/25 11:17:35

That "script" that you put in /etc/init.d is actually a systemd unit file and should be in /etc/systemd/system not in /etc/init.d.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

Post Reply