RedHat 7.2 Health Advisor mail command and systemd
Posted in 2016
Topics: Installation, Setup & Upgrades, Server Administration, Networking & sqlhosts Configuration, Platform-Specific Issues, Third-Party Tools & Monitoring
I'm reviewing Informix 12.10FC7W1 on Red Hat 7.2 (x86-64) and have come across a few items I though might be valuable to share with the group. First off, is anyone else running on this platform? I've created a systemd unit file to start and stop OAT, depending on another systemd unit file which starts/stops the Informix instance itself (devised from the version posted at http://www.iiug.org/2016/08/04/automatize-informix-startstop-with-systemd/) My /etc/systemd/system/informix.service unit file contains: [Unit] Description=Informix IDS Database Server Documentation=http://www.ibm.com/software/data/informix/library.html Wants=network-online.target After=network.target network-online.target [Service] Type=forking User=informix Group=informix EnvironmentFile=/etc/sysconfig/informix ExecStart=/ejust2/ejustcms/informix.ids/bin/oninit ExecStop=/ejust2/ejustcms/informix.ids/bin/onmode -ky #Restart=on-abort [Install] WantedBy=multi-user.target The /etc/sysconfig/informix file sets LANG, INFORMIXDIR, INFORMIXSERVER, INFORMIXSQLHOSTS, ONCONFIG and PATH appropriately for the system. My /etc/systemd/system/OAT.service file contains: [Unit] Description=Informix Apache HTTP Server After=network.target remote-fs.target nss-lookup.target informix.service Requires=informix.service [Service] Type=forking ExecStart=/ejust2/ejustcms/informix.ids/OAT/Apache_2.4.2/bin/apachectl -f /ejust2/ejustcms/informix.ids/OAT/Apache_2.4.2/conf/httpd.conf -k start ExecStop=/ejust2/ejustcms/informix.ids/OAT/Apache_2.4.2/bin/apachectl -f /ejust2/ejustcms/informix.ids/OAT/Apache_2.4.2/conf/httpd.conf -k stop PrivateTmp=true User=informix [Install] WantedBy=multi-user.target Of course after these unit files are created you have to run: systemctl daemon-reload systemctl enable informix systemctl enable OAT The OAT service requires that the informix service be running and systemd will start if it isn't already running. You can see that I've also chosen to run OAT as a non-root account. I did have to change permissions on the $INFORMIXDIR/OAT/Apache-2.4.2/logs dir as well as the directory that contains the connections.db file. I also had some challenges with the OAT 'Health Advisor' Notification command. According to the documentation, for Linux the command should be: /bin/mailx -s '[SUBJECT]' [TO] -- -f [FROM] < [MESSAGE] But using that command I received the message, but no body. I found the following workaround with which I am receiving the correct message with the report in the body: cat [MESSAGE] | /bin/mailx -s 'rhel7test [SUBJECT]' -r [FROM] [TO] I hope this this information can help someone else down the road.
Whooops - meant to post this in the OAT forum, sorry!
You can do it using systemd, but you can also just put your old init script in /etc/rc.d/init.d. It might need a few minor changes. On 10/7/2016 3:58 PM, PETE MCDONNELL wrote: > I'm reviewing Informix 12.10FC7W1 on Red Hat 7.2 (x86-64) and have come across > a few items I though might be valuable to share with the group. > > First off, is anyone else running on this platform? > > I've created a systemd unit file to start and stop OAT, depending on another > systemd unit file which starts/stops the Informix instance itself (devised > from the version posted at > http://www.iiug.org/2016/08/04/automatize-informix-startstop-with-systemd/) > > My /etc/systemd/system/informix.service unit file contains: > > [Unit] > Description=Informix IDS Database Server > Documentation=http://www.ibm.com/software/data/informix/library.html > Wants=network-online.target > After=network.target network-online.target > > [Service] > Type=forking > User=informix > Group=informix > EnvironmentFile=/etc/sysconfig/informix > ExecStart=/ejust2/ejustcms/informix.ids/bin/oninit > ExecStop=/ejust2/ejustcms/informix.ids/bin/onmode -ky > #Restart=on-abort > > [Install] > WantedBy=multi-user.target > > The /etc/sysconfig/informix file sets LANG, INFORMIXDIR, INFORMIXSERVER, > INFORMIXSQLHOSTS, ONCONFIG and PATH appropriately for the system. > > My /etc/systemd/system/OAT.service file contains: > > [Unit] > Description=Informix Apache HTTP Server > After=network.target remote-fs.target nss-lookup.target informix.service > Requires=informix.service > > [Service] > Type=forking > ExecStart=/ejust2/ejustcms/informix.ids/OAT/Apache_2.4.2/bin/apachectl -f > /ejust2/ejustcms/informix.ids/OAT/Apache_2.4.2/conf/httpd.conf -k start > ExecStop=/ejust2/ejustcms/informix.ids/OAT/Apache_2.4.2/bin/apachectl -f > /ejust2/ejustcms/informix.ids/OAT/Apache_2.4.2/conf/httpd.conf -k stop > PrivateTmp=true > User=informix > > [Install] > WantedBy=multi-user.target > > Of course after these unit files are created you have to run: > > systemctl daemon-reload > systemctl enable informix > systemctl enable OAT > > The OAT service requires that the informix service be running and systemd will > start if it isn't already running. > You can see that I've also chosen to run OAT as a non-root account. I did have > to change permissions on the $INFORMIXDIR/OAT/Apache-2.4.2/logs dir as well as > the directory that contains the connections.db file. > > I also had some challenges with the OAT 'Health Advisor' Notification command. > According to the documentation, for Linux the command should be: > > /bin/mailx -s '[SUBJECT]' [TO] -- -f [FROM] < [MESSAGE] > > But using that command I received the message, but no body. I found the > following workaround with which I am receiving the correct message with the > report in the body: > > cat [MESSAGE] | /bin/mailx -s 'rhel7test [SUBJECT]' -r [FROM] [TO] > > I hope this this information can help someone else down the road. > > > ******************************************************************************* > Forum Note: Use "Reply" to post a response in the discussion forum. > > > >