PP-280: Introduce unit file for systems that supports systemd process management

Target releaseFuture release/15.0
Epic

PP-280 - Introduce unit file for systems that supports systemd process management IN PROGRESS

Document status
DRAFT
Document OwnerNithin Johnson


PBS should support start up using systemd in supported platforms.

EDD

Interface1: Admin can use systemd to start and stop PBS services: 

 

  • Visibility: Public
  • Change Control: Stable
  • Synopsis: Systemd can be used to start and stop PBS services on systems which supports systemd.
  • Details: From 15.0 release, systemd commands can be used on supported systems.
    • Systems that have systemd: suse >=1210 and rhel >=7
    • sysvinit script will be still present in the same location, and this functionality is not deprecated.
      • Usage
        sysvinit
        alternative in systemd
        starting/etc/init.d/pbs startsystemctl start pbs
        stopping/etc/init.d/pbs stopsystemctl stop pbs
        status/etc/init.d/pbs statussystemctl status pbs
        restart/etc/init.d/pbs restartsystemctl restart pbs
      • pbs_postinstall will configure PBS to be automatically started at boot time.
      • The logs which are displayed on stdout from /etc/init.d/pbs will not be displayed when systemctl is used to start pbs services.
      • But these logs can be seen with systemctl status command.
        • [root@vbox pbspro]# systemctl status pbs
          ● pbs.service - Portable Batch System
          Loaded: loaded (/opt/pbs/default/libexec/pbs_init.d; enabled; vendor preset: disabled)
          Active: active (running) since Wed 2016-08-10 15:23:48 IST; 21h ago
          Docs: man:pbs(8)
          Process: 101261 ExecStart=/opt/pbs/default/libexec/pbs_init.d start start (code=exited, status=0/SUCCESS)
          CGroup: /system.slice/pbs.service
          ├─104185 /opt/pbs/default/sbin/pbs_comm
          ├─104229 /opt/pbs/default/sbin/pbs_mom
          ├─104267 /opt/pbs/default/sbin/pbs_sched
          ├─104582 /opt/pbs/default/sbin/pbs_ds_monitor monitor
          ├─104645 /opt/pbs/14.101/pgsql/bin/postgres -D /var/spool/PBS/datastore -p 15007
          ├─104648 postgres: logger process 
          ├─104651 postgres: checkpointer process 
          ├─104652 postgres: writer process 
          ├─104653 postgres: wal writer process 
          ├─104654 postgres: autovacuum launcher process 
          ├─104655 postgres: stats collector process 
          ├─104771 postgres: pbsdata pbs_datastore 192.168.153.140(44113) idle
          └─104772 /opt/pbs/default/sbin/pbs_server.bin

          Aug 10 15:23:44 vbox pbs_init.d[101261]: PBS sched
          Aug 10 15:23:44 vbox su[104295]: (to pbsdata) root on none
          Aug 10 15:23:44 vbox su[104357]: (to pbsdata) root on none
          Aug 10 15:23:45 vbox su[104446]: (to pbsdata) root on none
          Aug 10 15:23:45 vbox su[104510]: (to pbsdata) root on none
          Aug 10 15:23:45 vbox su[104583]: (to pbsdata) root on none
          Aug 10 15:23:48 vbox pbs_init.d[101261]: Connecting to PBS dataservice....connected to PBS dataservice@vbox
          Aug 10 15:23:48 vbox pbs_init.d[101261]: Licenses valid for 1000000 Floating hosts
          Aug 10 15:23:48 vbox pbs_init.d[101261]: PBS server
          Aug 10 15:23:48 vbox systemd[1]: Started Portable Batch System.

      • If the start-up fails, command will throw an error as follows - 
        • [root@vbox nithinj]# systemctl start pbs
          Job for pbs.service failed because the control process exited with error code. See "systemctl status pbs.service" and "journalctl -xe" for details.

      • "systemctl status pbs"  or "journalctl -u pbs" will lead to the specific reason behind the failure.
      • The following command can be used to start pbs using systemd after the installation - "systemctl daemon-reload && systemctl start pbs"
        daemon-reload is used to reload all systemd units if they got modified or newly added.
      • "systemctl enable pbs" This will enable pbs to be started on bootup. This functionality will be disabled by default.
      • systemctl reload will update the configuration file if modified. But in case of pbs the suggested method will be "systemctl restart" since daemons updates new values only while starting the service.
      • Possible Enhancements in future: We can convert start up script into C/C++ binary so that system start up will become more faster.