[SOLVED] Failed to restart opsiconfd.service: No such method 'RestartUnit'

dorian.borovina
Beiträge: 36
Registriert: 24 Aug 2017, 12:32

[SOLVED] Failed to restart opsiconfd.service: No such method 'RestartUnit'

Beitrag von dorian.borovina »

Hi,

It's me again, but this time with different problem.

I've upgraded Linux server from Debian 7 to Debian 9, upgraded the OPSI Server from 4.0 to 4.1, including the packages.

Everything works as it should, except one little thing.

When I execute following code, I get the following output.

Code: Alles auswählen

systemctl restart opsiconfd.service

Code: Alles auswählen

Failed to restart opsiconfd.service: No such method 'RestartUnit'
See system logs and 'systemctl status opsiconfd.service' for details.
When I check it with the following code, looks ok than.

Code: Alles auswählen

service opsiconfd status
Checking opsi config service... (running).
OPSI-Configed, shares, depots, they're all available and working.

Any hints?

EDIT: Some useful outputs. :)

Code: Alles auswählen

ps -ef | grep opsiconfd
opsicon+  2713     1  0 08:54 ?        00:00:05 /usr/bin/python /usr/bin/opsiconfd -D
root      3590 27973  0 09:22 pts/0    00:00:00 grep opsiconfd

Code: Alles auswählen

ps -ef | grep opsipxeconfd
root      2757     1  0 08:54 ?        00:00:01 /usr/bin/python /usr/bin/opsipxeconfd start
root      3594 27973  0 09:23 pts/0    00:00:00 grep opsipxeconfd

Code: Alles auswählen

ps -ef | grep mbd
root      3688 30167  0 09:24 ?        00:00:00 /usr/sbin/smbd -D
root      3695 27973  0 09:24 pts/0    00:00:00 grep mbd
root     30114     1  0 08:29 ?        00:00:00 /usr/sbin/nmbd -D
root     30167     1  0 08:29 ?        00:00:00 /usr/sbin/smbd -D
root     30169 30167  0 08:29 ?        00:00:00 /usr/sbin/smbd -D
root     30171 30167  0 08:29 ?        00:00:00 /usr/sbin/smbd -D
root     30175 30167  0 08:29 ?        00:00:00 /usr/sbin/smbd -D

Code: Alles auswählen

dpkg -l | grep opsi
rc  opsi-atftpd                          0.7.dfsg-7                     amd64        advanced TFTP server - opsi version with pcre, fifo and max-blksize patches
ii  opsi-configed                        4.0.7.6.34-2                   all          OPSI config editor
ii  opsi-depotserver                     4.1.0.0-3                      all          transitional package
ii  opsi-linux-bootimage                 20180208-1                     amd64        opsi bootimage for netboot tasks.
ii  opsi-server                          4.1.1.4-10                     all          opsi server configuration package
ii  opsi-tftpd-hpa                       5.2.8-47                       amd64        HPA's tftp server
ii  opsi-utils                           4.1.1.19-2                     all          utilites for working with opsi.
ii  opsi-windows-support                 4.1.1-5                        all          Install utilities useful for deploying Windows with opsi.
ii  opsiconfd                            4.1.1.10-7                     all          opsi configuration service
ii  opsipxeconfd                         4.1.1.9-1                      all          opsi pxe configuration daemon
ii  python-opsi                          4.1.1.29-1                     all          opsi python library
Zuletzt geändert von dorian.borovina am 04 Jul 2018, 17:44, insgesamt 1-mal geändert.
Best regards,
Dorian Borovina
Benutzeravatar
n.wenselowski
Ex-uib-Team
Beiträge: 3194
Registriert: 04 Apr 2013, 12:15

Re: Failed to restart opsiconfd.service: No such method 'RestartUnit'

Beitrag von n.wenselowski »

Hi,

I can't reproduce this on a from-scratch Debian 9.

Has the machine been rebootet inbetween?
What versions of systemd do you have installed? On mine it is 232-25.
Did you change the repository of opsi to the one for debian 9?
Maybe a reinstallation of the opsiconfd package does help.


Regards

Niko

Code: Alles auswählen

import OPSI
dorian.borovina
Beiträge: 36
Registriert: 24 Aug 2017, 12:32

Re: Failed to restart opsiconfd.service: No such method 'RestartUnit'

Beitrag von dorian.borovina »

Hi Niko,

Machine has been rebooted, but I will do it once more, just to be sure.

Systemd version is 232-25+deb9u3

Location of the OPSI.list

Code: Alles auswählen

/etc/apt/sources.list.d/opsi.list
Content of the OPSI.list

Code: Alles auswählen

deb http://download.opensuse.org/repositories/home:/uibmz:/opsi:/4.1:/stable/Debian_9.0/ /
Reinstallation of the opsiconfd

Code: Alles auswählen

apt-get install --reinstall opsiconfd
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 0 not upgraded.
Need to get 49.7 kB of archives.
After this operation, 0 B of additional disk space will be used.
Get:1 http://download.opensuse.org/repositories/home:/uibmz:/opsi:/4.1:/stable/Debian_9.0  opsiconfd 4.1.1.10-7 [49.7 kB]
Fetched 49.7 kB in 0s (114 kB/s)
Preconfiguring packages ...
OK
(Reading database ... 65930 files and directories currently installed.)
Preparing to unpack .../opsiconfd_4.1.1.10-7_all.deb ...
Stopping opsi config service....   (done).
Unpacking opsiconfd (4.1.1.10-7) over (4.1.1.10-7) ...
Setting up opsiconfd (4.1.1.10-7) ...
Starting opsi config service.......   (done).
/etc/init.d/opsiconfd: 104: /etc/init.d/opsiconfd: /usr/bin/opsiconfd-guard: not found
OK
/etc/init.d/opsiconfd: 63: /etc/init.d/opsiconfd: /usr/bin/opsiconfd-guard: not found
Synchronizing state of opsiconfd.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable opsiconfd
Enabled opsiconfd.service

/etc/init.d/opsiconfd: 63: /etc/init.d/opsiconfd: /usr/bin/opsiconfd-guard: not found


This might be to problem?

Thank you for your reply.

EDIT: Machine rebooted, problem still persists.
Best regards,
Dorian Borovina
Benutzeravatar
n.wenselowski
Ex-uib-Team
Beiträge: 3194
Registriert: 04 Apr 2013, 12:15

Re: Failed to restart opsiconfd.service: No such method 'RestartUnit'

Beitrag von n.wenselowski »

Hi,

for opsi 4.1 we use only systemd and /etc/init.d/opsiconfd should be gone with the installation of the new opsiconfd.

Can you show the ouput of:

Code: Alles auswählen

service status opsiconfd.service
service cat opsiconfd.service
The last commend should be like the distributed file.


Kind regards

Niko

Code: Alles auswählen

import OPSI
dorian.borovina
Beiträge: 36
Registriert: 24 Aug 2017, 12:32

Re: Failed to restart opsiconfd.service: No such method 'RestartUnit'

Beitrag von dorian.borovina »

Hi Niko,

Here is the output:

Code: Alles auswählen

service status opsiconfd.service
status: unrecognized service
But this looks okay:

Code: Alles auswählen

service opsiconfd status
Checking opsi config service... (running).
I couldn't find the service by executing the second command, so I did this.

Code: Alles auswählen

locate opsiconfd.service
/etc/systemd/system/multi-user.target.wants/opsiconfd.service
/lib/systemd/system/opsiconfd.service
/var/lib/systemd/deb-systemd-helper-enabled/multi-user.target.wants/opsiconfd.service
/var/lib/systemd/deb-systemd-helper-enabled/opsiconfd.service.dsh-also

This one looks okay?
/lib/systemd/system/opsiconfd.service

Here is the output:

Code: Alles auswählen

[Unit]
Description=Opsi Configuration Service
After=mysql.service
After=smbd.service
Wants=isc-dhcp-server.service
Wants=mysql.service
Wants=smbd.service

[Service]
User=opsiconfd
Type=forking
ExecStart=/usr/bin/opsiconfd -D
PIDFile=/var/run/opsiconfd/opsiconfd.pid
Restart=always
RestartSec=10
KillMode=process
TimeoutStopSec=10

# Fix for maybe not existing /var/run or wrong permissions
# PermissionsStartOnly makes the switch to the opsiconfd user just
# before executing the ExecStart-part.
PermissionsStartOnly=True
ExecStartPre=-/bin/mkdir -p /var/run/opsiconfd
ExecStartPre=-/bin/chown -R opsiconfd /var/run/opsiconfd/

[Install]
WantedBy=multi-user.target
Thank you! :)
Best regards,
Dorian Borovina
Benutzeravatar
n.wenselowski
Ex-uib-Team
Beiträge: 3194
Registriert: 04 Apr 2013, 12:15

Re: Failed to restart opsiconfd.service: No such method 'RestartUnit'

Beitrag von n.wenselowski »

Hi,

sorry, I should not type when in a hurry.

Can you show the ouput of (this time with the right commands :)):

Code: Alles auswählen

systemctl status opsiconfd.service
systemctl cat opsiconfd.service
The last commend should be like the distributed file.


Kind regards

Niko

Code: Alles auswählen

import OPSI
dorian.borovina
Beiträge: 36
Registriert: 24 Aug 2017, 12:32

Re: Failed to restart opsiconfd.service: No such method 'RestartUnit'

Beitrag von dorian.borovina »

Hi Niko,

No worries, everything is under control. If not, it will be :)

Here is the first output:

Code: Alles auswählen

systemctl status opsiconfd.service
Failed to get properties: No such interface ''
And here is the second output:

Code: Alles auswählen

systemctl cat opsiconfd.service
# /lib/systemd/system/opsiconfd.service
[Unit]
Description=Opsi Configuration Service
After=mysql.service
After=smbd.service
Wants=isc-dhcp-server.service
Wants=mysql.service
Wants=smbd.service

[Service]
User=opsiconfd
Type=forking
ExecStart=/usr/bin/opsiconfd -D
PIDFile=/var/run/opsiconfd/opsiconfd.pid
Restart=always
RestartSec=10
KillMode=process
TimeoutStopSec=10

# Fix for maybe not existing /var/run or wrong permissions
# PermissionsStartOnly makes the switch to the opsiconfd user just
# before executing the ExecStart-part.
PermissionsStartOnly=True
ExecStartPre=-/bin/mkdir -p /var/run/opsiconfd
ExecStartPre=-/bin/chown -R opsiconfd /var/run/opsiconfd/

[Install]
WantedBy=multi-user.target
root@PY-OPSI:/home/opsiadmin#
Thank you!
Best regards,
Dorian Borovina
Benutzeravatar
n.wenselowski
Ex-uib-Team
Beiträge: 3194
Registriert: 04 Apr 2013, 12:15

Re: Failed to restart opsiconfd.service: No such method 'RestartUnit'

Beitrag von n.wenselowski »

Hi,

the second output looks fine from a glance but this is worrying:
dorian.borovina hat geschrieben:

Code: Alles auswählen

systemctl status opsiconfd.service
Failed to get properties: No such interface ''
There seems to be some issue with your systemd setup.

Did you do any init-System experiments on the machine? (Like installing upstart)
I'd try finding some more information about that error and I think once this is resolved everything should work for you.


Kind regards

Niko

Code: Alles auswählen

import OPSI
dorian.borovina
Beiträge: 36
Registriert: 24 Aug 2017, 12:32

Re: Failed to restart opsiconfd.service: No such method 'RestartUnit'

Beitrag von dorian.borovina »

Hi,

Thanks for the quick reply.

I'll investigate the problem and will let you know the outcome.

Best regards!
Best regards,
Dorian Borovina
dorian.borovina
Beiträge: 36
Registriert: 24 Aug 2017, 12:32

Re: Failed to restart opsiconfd.service: No such method 'RestartUnit'

Beitrag von dorian.borovina »

SOLUTION: I don't know how, but the problem is now solved.

I did the reboot, and after the reboot I tried the following.

NOTE: Rebooted the machine yesterday at least 3-4 times, no changes.

I typed in systemctl in the OPSI console, just to the see which services are running.
  • open-vm-tools.service loaded active running Service for virtual machines hosted on VMware
    opsi-atftpd.service loaded active exited LSB: launch atftpd server
    opsi-tftpd-hpa.service loaded active running Opsi TFTPD HPA Configuration Service
    opsiconfd.service loaded active running Opsi Configuration Service
    opsipxeconfd.service loaded active running Opsi PXE Configuration Service
Hmm, that's strange, the services are already in here, they're running, loaded, active. Damn!

Let's try again with the systemctl status opsiconfd.service

Code: Alles auswählen

● opsiconfd.service - Opsi Configuration Service
   Loaded: loaded (/etc/systemd/system/opsiconfd.service; enabled; vendor preset: enabled)
   Active: active (running) since Wed 2018-07-04 17:29:58 CEST; 5min ago
  Process: 1226 ExecStart=/usr/bin/opsiconfd -D (code=exited, status=0/SUCCESS)
  Process: 1224 ExecStartPre=/bin/chown -R opsiconfd /var/run/opsiconfd/ (code=exited, status=0/SUCCESS)
  Process: 1221 ExecStartPre=/bin/mkdir -p /var/run/opsiconfd (code=exited, status=0/SUCCESS)
 Main PID: 1238 (opsiconfd)
    Tasks: 1 (limit: 4915)
   CGroup: /system.slice/opsiconfd.service
           └─1238 /usr/bin/python /usr/bin/opsiconfd -D

Jul 04 17:29:55 PY-OPSI systemd[1]: Starting Opsi Configuration Service...
Jul 04 17:29:56 PY-OPSI systemd[1]: opsiconfd.service: PID file /var/run/opsiconfd/opsiconfd.pid not readable (yet?) after start: No such file or directory
Jul 04 17:29:58 PY-OPSI systemd[1]: Started Opsi Configuration Service.
WTF is this?! It works now?

Executing the systemctl restart opsiconfd.service, no output whatsoever, looks like it's okay.

So, solution is, wait one day, reboot the machine and execute the systemctl just to see which services are running. :?
Best regards,
Dorian Borovina
Antworten