PxPlus User Forum

Main Board => Discussions => ODBC => Topic started by: Sam Nehama on March 31, 2020, 04:54:18 PM

Title: Red Hat 7 systemctl start of ODBC server
Post by: Sam Nehama 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...
Title: Re: Red Hat 7 systemctl start of ODBC server
Post by: Mike King 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.shellhacks.com/systemd-service-file-example/)

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

Title: Re: Red Hat 7 systemctl start of ODBC server
Post by: Sam Nehama 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
Title: Re: Red Hat 7 systemctl start of ODBC server
Post by: Sam Nehama on May 29, 2020, 05:25:21 PM
FYI, to resolve this, I added an ExecStop statement to rc-local.service.