PxPlus User Forum

Twitter Twitter Twitter

Author Topic: Red Hat 7 systemctl start of ODBC server  (Read 1626 times)

Sam Nehama

  • Member
  • **
  • Posts: 15
    • View Profile
Red Hat 7 systemctl start of ODBC server
« on: March 31, 2020, 04:54:18 PM »
Can anyone please post a sample of a systemctl script that starts the pvxiosvr program?  What we have either gives an error trying to run the pvxiosvr program (states it is not a binary file) or it just does not run at all.  It appears that starting from the command line the program will run.

It's version 5.1 or 5.2...

Mike King

  • Diamond Member
  • *****
  • Posts: 3810
  • Mike King
    • View Profile
    • BBSysco Consulting
Re: Red Hat 7 systemctl start of ODBC server
« Reply #1 on: March 31, 2020, 05:39:04 PM »
While a systemctl file is nice, why not just use inittab or in Centos (and most other Linux systems) add to /etc/rc.d/rc.local?

If you do need to use systemctl here is are some links that may help

https://www.shellhacks.com/systemd-service-file-example/

https://www.devdungeon.com/content/creating-systemd-service-files

Mike King
President - BBSysco Consulting
eMail: mike.king@bbsysco.com

Sam Nehama

  • Member
  • **
  • Posts: 15
    • View Profile
Re: Red Hat 7 systemctl start of ODBC server
« Reply #2 on: May 27, 2020, 02:14:40 PM »
Mike,

We did set up an rc.local file that worked.  We have not rebooted until today.  Please see contents of rc.local below.  I simply did an init 6 to reboot.  The system displayed "A stop job is running for /etc/rc.d/rc.local  Compatibility  (9 min 9s  / no limit). Thoughts? I don't think the system ever rebooted and we had to hard boot it.

# cat rc.local
#!/bin/bash
# THIS FILE IS ADDED FOR COMPATIBILITY PURPOSES
#
# It is highly advisable to create own systemd services or udev rules
# to run scripts during boot instead of using this file.
#
# In contrast to previous versions due to parallel execution during boot
# this script will NOT be run after all other services.
#
# Please note that you must run 'chmod +x /etc/rc.d/rc.local' to ensure
# that this script will be executed during boot.

touch /var/lock/subsys/local
exec /usr/pxpiosvr/pxpiosvr -f /usr/pxpiosvr/pxpiosvr.conf -p 20222 &
[root@paper-rbconverting-com rc.d]#

Thanks,
Sam

Sam Nehama

  • Member
  • **
  • Posts: 15
    • View Profile
Re: Red Hat 7 systemctl start of ODBC server
« Reply #3 on: May 29, 2020, 05:25:21 PM »
FYI, to resolve this, I added an ExecStop statement to rc-local.service.