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.
How to 'debug' boot problems
-
- Posts: 1522
- Joined: 2014/05/21 20:16:00
- Location: Central New York, USA
Re: How to 'debug' boot problems
instead of "chkconfig --add" try
systemctl enable {servicename}
CentOS 7 is different
systemctl enable {servicename}
CentOS 7 is different
Re: How to 'debug' boot problems
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:
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
-
- Posts: 1522
- Joined: 2014/05/21 20:16:00
- Location: Central New York, USA
Re: How to 'debug' boot problems
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:
/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
Re: How to 'debug' boot problems
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
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