[CentOS 7 ] not able to start opennebula

Hi.

today we start a fresh install to move our cloud to new machine.

we install CentOS7 using netinstall, and after using the rpm from centos7

at first all fine. service start, and run (opennebula.service opennebula-sunstone)

but… if we reboot the machine and launch the comand we retreived an error:

Dec 15 10:23:29 nebula systemd: Starting OpenNebula Cloud Controller Daemon... Dec 15 10:23:29 nebula systemd: Started OpenNebula Cloud Controller Daemon. Dec 15 10:23:29 nebula systemd: Starting OpenNebula Cloud Scheduler Daemon... Dec 15 10:23:29 nebula systemd: Started OpenNebula Cloud Scheduler Daemon. Dec 15 10:23:29 nebula oned: Error: Cannot start oned, opening lock file /var/lock/one/one Dec 15 10:23:30 nebula systemd: opennebula.service: main process exited, code=exited, status=255/n/a Dec 15 10:23:30 nebula systemd: Stopping OpenNebula Cloud Scheduler Daemon... Dec 15 10:23:30 nebula kill: Usage: Dec 15 10:23:30 nebula kill: kill [options] <pid|name> [...] Dec 15 10:23:30 nebula kill: Options: Dec 15 10:23:30 nebula kill: -a, --all do not restrict the name-to-pid conversion to processes Dec 15 10:23:30 nebula kill: with the same uid as the present process Dec 15 10:23:30 nebula kill: -s, --signal <sig> send specified signal Dec 15 10:23:30 nebula kill: -q, --queue <sig> use sigqueue(2) rather than kill(2) Dec 15 10:23:30 nebula kill: -p, --pid print pids without signaling them Dec 15 10:23:30 nebula kill: -l, --list [=<signal>] list signal names, or convert one to a name Dec 15 10:23:30 nebula kill: -L, --table list signal names and numbers Dec 15 10:23:30 nebula kill: -h, --help display this help and exit Dec 15 10:23:30 nebula kill: -V, --version output version information and exit Dec 15 10:23:30 nebula kill: For more details see kill(1). Dec 15 10:23:30 nebula systemd: opennebula.service: control process exited, code=exited status=1 Dec 15 10:23:30 nebula systemd: Stopped OpenNebula Cloud Controller Daemon. Dec 15 10:23:30 nebula systemd: Unit opennebula.service entered failed state. Dec 15 10:23:30 nebula systemd: Stopped OpenNebula Cloud Scheduler Daemon.
similar error

`[root@nebula ~]# systemctl status opennebula.service
opennebula.service - OpenNebula Cloud Controller Daemon
Loaded: loaded (/usr/lib/systemd/system/opennebula.service; disabled)
Active: failed (Result: exit-code) since mar 2015-12-15 10:23:30 CET; 6min ago
Process: 1133 ExecStop=/bin/kill -TERM $MAINPID (code=exited, status=1/FAILURE)
Process: 1129 ExecStart=/usr/bin/oned -f (code=exited, status=255)
Process: 1126 ExecStartPre=/bin/chown oneadmin:oneadmin /var/log/one (code=exited, status=0/SUCCESS)
Process: 1124 ExecStartPre=/bin/mkdir -p /var/log/one (code=exited, status=0/SUCCESS)
Main PID: 1129 (code=exited, status=255)

dic 15 10:23:30 nebula.cesga.es kill[1133]: -q, --queue use sigqueue(2) rather than kill(2)
dic 15 10:23:30 nebula.cesga.es kill[1133]: -p, --pid print pids without signaling them
dic 15 10:23:30 nebula.cesga.es kill[1133]: -l, --list [=] list signal names, or convert one to a name
dic 15 10:23:30 nebula.cesga.es kill[1133]: -L, --table list signal names and numbers
dic 15 10:23:30 nebula.cesga.es kill[1133]: -h, --help display this help and exit
dic 15 10:23:30 nebula.cesga.es kill[1133]: -V, --version output version information and exit
dic 15 10:23:30 nebula.cesga.es kill[1133]: For more details see kill(1).
dic 15 10:23:30 nebula.cesga.es systemd[1]: opennebula.service: control process exited, code=exited status=1
dic 15 10:23:30 nebula.cesga.es systemd[1]: Stopped OpenNebula Cloud Controller Daemon.
dic 15 10:23:30 nebula.cesga.es systemd[1]: Unit opennebula.service entered failed state.
`

the file instaled:

``[root@nebula ~]# cat /usr/lib/systemd/system/opennebula.service
[Unit]
Description=OpenNebula Cloud Controller Daemon
After=syslog.target
After=network.target
After=remote-fs.target
After=mariadb.service
Before=opennebula-scheduler.service
BindTo=opennebula-scheduler.service

[Service]
Type=simple
Group=oneadmin
User=oneadmin

# Start daemon in forground mode, when starting as forking process the
# daemon shuts down without obvious reason.
ExecStart=/usr/bin/oned -f
# Log file location must exist
ExecStartPre=/bin/mkdir -p /var/log/one
ExecStartPre=/bin/chown oneadmin:oneadmin /var/log/one
ExecStop=/bin/kill -TERM $MAINPID
PIDFile=/var/run/one/oned.pid

[Install]
WantedBy=multi-user.target

any idea? i think the kill not work with $MAINPID but not sure how fix.

Thanks in advance.

Hi there,
as stated here, check with pgrep if you have other oned or mm_sched processes already running and kill them, then remove the /var/lock/one/one file if it does exist. Maybe a permissions issue when you started opennebula the fist time, and systemd trying to kill the wrong PID?

I think the problem is that file /var/lock/one not exists

its that normal? in when the directory one is created at? because if i create the dir (/var/lock/one) and change the permision th oneadmin. then service start whitout problem.

any idea how solve (and not make a cron to create every boot hehe)

Hi,
in my CentOS 7 node with opennebula and opennebula-sunstone running and showing active state, a /var/lock/one/one file does exist.

I think that the systemd-tmpfiles which creates, deletes and cleans up volatile and temporary files and directories is the responsible of creating and managing the /var/lock/one folder. There should be a /usr/lib/tmpfiles.d/opennebula.conf file explaining what OpenNebula’s folders and permissions should create the tmpfiles:

d /var/lock/one 0755 oneadmin oneadmin -
d /var/run/one 0755 oneadmin oneadmin -

This is what I get to check my systemd services and filtering by tmpfiles:
[root@node1 one]# systemctl list-units -all | grep tmpfiles
systemd-tmpfiles-clean.service loaded inactive dead Cleanup of Temporary Directories
systemd-tmpfiles-setup-dev.service loaded active exited Create static device nodes in /dev
systemd-tmpfiles-setup.service loaded active exited Create Volatile Files and Directories
systemd-tmpfiles-clean.timer loaded active waiting Daily Cleanup of Temporary Directories

Maybe tmpfiles is not running or working as expected, or having problems to create the /var/lock/one folder due to permissions?

Sorry, I don’t want to confuse you saying do this and do that, just trying to help to discard some issues (e.g be sure that SELinux is disabled!) so maybe another forum’s user gives you the best and quicker shot to solve the issue.

1 Like

mmm thanks i think system-tmpfiles-setup are not working fine.

my output its diferent.

[root@nebula lock]# systemctl list-units -all | grep tmpfiles
systemd-tmpfiles-clean.service                                                           loaded inactive dead      Cleanup of Temporary Directories
systemd-tmpfiles-setup-dev.service                                                       loaded active   exited    Create static device nodes in /dev
systemd-tmpfiles-setup.service                                                           loaded failed   failed    Create Volatile Files and Directories
systemd-tmpfiles-clean.timer                                                             loaded active   waiting   Daily Cleanup of Temporary Directories

im going to see in that way

Thanks so much :slight_smile: