SLES 12 SP4 Agent install and start issue

i am trying to install agent on SLES 12 SP4 server but getting issue while starting up agent service and getting below message.

ip-10-204-1-56:~ # /etc/init.d/besclient start
redirecting to systemctl start besclient.service
Failed to start besclient.service: Unit besclient.service failed to load: No such file or directory.

ip-10-204-1-56:~ # rpm -qa |grep -i bes
libesmtp-1.0.6-16.1.x86_64
libestr0-0.1.9-1.54.x86_64
BESAgent-9.5.9.62-sle11.x86_64
ip-10-204-1-56:~ #

ip-10-204-1-56:~ # cat /etc/os-release
NAME="SLES"
VERSION="12-SP4"
VERSION_ID="12.4"
PRETTY_NAME="SUSE Linux Enterprise Server 12 SP4"
ID="sles"
ANSI_COLOR="0;32"
CPE_NAME="cpe:/o:suse:sles:12:sp4"ip-10-204-1-56:~ #

I checked the packages and the SuSE agent shouldn’t be redirecting to systemctl that I know of. This sounds like a misconfiguration somewhere.

i created systemd package , but looks like it is starting up the service only when i remove stop command and it never stop which BESClient.service in /etc/systemd/system dir

[Unit]
Description=IBM Bigfix Agent Service
After=network.target

[Service]
Type=simple
ExecStart=/etc/init.d/besclient start
ExecStop=/etc/init.d/besclient stop
ExecReload=/bin/kill -HUP $MAINPID
KillMode=process
Restart=on-failure
RestartSec=42s

[Install]
WantedBy=multi-user.target

Would a systemctl daemon-reload command help?

yes only to reload new file which i created

file created under /usr/lib/systemd/system and link file created under /etc/systemd/system
cd /etc/systemd/system
ln -s /usr/lib/systemd/system/beslclient.service besclient.service

ip-10-204-1-56:/usr/lib/systemd/system # cat besclient.service
[Unit]
Description=IBM Bigfix Agent Service
After=network.target

[Service]
Type=simple
ExecStart=/etc/init.d/besclient start
ExecStop=/etc/init.d/besclient status
ExecReload=/bin/kill -HUP $MAINPID
KillMode=process
Restart=on-failure
RestartSec=42s

[Install]
WantedBy=multi-user.target

I can start the service without issue

ip-10-204-1-56:/usr/lib/systemd/system # ps -ef |grep -i bes
root      9643  8360  0 17:53 pts/1    00:00:00 tail -f /var/opt/BESClient/__BESData/__Global/Logs/20190219.log
root      9654     1  2 17:54 ?        00:00:03 /opt/BESClient/bin/BESClient
nobody    9665  9654  0 17:54 ?        00:00:00 /opt/BESClient/bin/BESClient -RPMHelper
root      9681  6664  0 17:56 pts/0    00:00:00 grep --color=auto -i bes
ip-10-204-1-56:/usr/lib/systemd/system

Process

ip-10-204-1-56:/usr/lib/systemd/system # systemctl status besclient.service -l
â—Ź besclient.service - IBM Bigfix Agent Service
   Loaded: loaded (/usr/lib/systemd/system/besclient.service; linked; vendor preset: disabled)
   Active: **inactive** (**dead**) since Tue 2019-02-19 17:54:01 UTC; 3min 24s ago
  Process: 9655 ExecStop=/etc/init.d/besclient status (code=exited, status=0/SUCCESS)
  Process: 9644 ExecStart=/etc/init.d/besclient start (code=exited, status=0/SUCCESS)
 Main PID: 9644 (code=exited, status=0/SUCCESS)
    Tasks: 7 (limit: 512)
   CGroup: /system.slice/besclient.service
           ├─9654 /opt/BESClient/bin/BESClient
           └─9665 /opt/BESClient/bin/BESClient -RPMHelper

Feb 19 17:54:01 ip-10-204-1-56 systemd[1]: Started IBM Bigfix Agent Service.
Feb 19 17:54:01 ip-10-204-1-56 besclient[9644]: Starting BigFix: BESClient..done
Feb 19 17:54:01 ip-10-204-1-56 besclient[9655]: Checking for service BigFix: BESClient: ..running
ip-10-204-1-56:/usr/lib/systemd/system #

process always shows up dead and inactive though service is running , i can’t stop the service but have to kill manually in this case as i when i try to add stop command it immediately stop the service while starting up. that’s why i added status command in systemd service . though i good as of now but need a finally solution from Bigfix Dev team for SLES 12 :slight_smile:

So you added the systemctl connection? The SuSE agent isn’t yet designed to work in that scenario to my knowledge which may be why you are having issues

Yes i added systemctl connection , but SLES 12 services works with systemd , so IBM has to fix agent issue for SLES 12

Here’s what I had to do to run my systemd based system:
I changed the system INIT file provided above thus:

[Unit]
Description=IBM Bigfix Agent Service
After=network.target

[Service]
Type=simple
PIDFile=/run/besclient
ExecStartPre=/usr/bin/rm -f /run/besclient
ExecStart=/etc/init.d/besclient start
ExecStop=/etc/init.d/besclient stop
ExecReload=/bin/kill -HUP $MAINPID
KillMode=process
Restart=on-failure
RestartSec=42s

[Install]
WantedBy=multi-user.target

To support the PIDFile creation, I modified the /etc/init.d/besclient script thus:

start() {
. . .
        [ $ret -eq 0 ] && /bin/touch /var/lock/subsys/$prog
        pid=`pidof /opt/BESClient/bin/$prog`
        /bin/echo $pid >/run/besclient
        /bin/echo
        return $ret
}

stop() {
. . .
        [ $ret -eq 0 ] && rm -f /var/lock/subsys/$prog && rm -f /run/besclient
        /bin/echo
        return $ret
}
1 Like