systemd DB2 StartUp/Shutdown service on Red Hat Enterprise Linux Server release 7.4 (Maipo)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello aleivag,
Thank you for answering my email.
Iâ??ve made some changes to db2.service file but unfortunately the problem on reboot still persists.
Please review the contents of the service file and hopefully you have some other recommendations.

Regards.

[Unit]
Description=DB2 StartUp-Shutdown
After=network.target rsyslog.service sshd.service dbus.service opt-IBM-DB2.mount var.mount var-db2-home.mount
RequiresMountsFor=/gppactlog /gpparclog /gppdata01 /gppdata02 /gppdata03 /gppdbpath /gppdump /gppmirlog

[Service]
Type=forking
RemainAfterExit=yes
User=achdut2
ExecStart=/bin/sh -c '/var/db2/home/achdut2/sqllib/adm/db2start'
ExecStop=/bin/sh -c '/var/db2/home/achdut2/sqllib/adm/db2stop force'
Restart=always
Environment="DB2INSTANCE=achdut2"

[Install]
WantedBy=multi-user.target


From: aleivag [mailto:aleivag@xxxxxxxxx]
Sent: Thursday, May 24, 2018 5:16 PM
To: Leonard Rofman
Cc: systemd-devel at lists.freedesktop.org
Subject: Re: systemd DB2 StartUp/Shutdown service on Red Hat Enterprise Linux Server release 7.4 (Maipo)

`Before` means that if your service and everything in `Before` (e.g. shutdown.target) is started at the same time, your service will be started Before the other, but when all are been stopped, your service will get Stoped After the other (you can see why you don't want your service stopped after shutdown.taregt), After is the opposite of that.

a couple of tips on this

i would remove the Before and the Conflicts, and enable your service. since its in multi-user.taget, it will get stoped alongside all other services.

I would put in "After" all the things you need to have runing while shutting down your service... its a database, you probably dont need weird stuff.. but if you connect to any other service in the same box you probably want to put those there. i normally put sshd.service and dbus.service, because i like to be able ssh and look at the things that are been shutting down, and dbus because you want a semi-funtional. keep in mind that this 2 are probably irrelevant, since you have After=network.target.

pro-tip on "After" you can also put "mounts" to make sure you have a fs to work with.

sometimes you want to increase the TimeoutStopSec and maybe if your ExecStop exit inmediatly, a "sleep X"  at the end

everithing else looks good.

Hope it helps




Alvaro Leiva

On Thu, May 24, 2018 at 12:52 PM, Leonard Rofman <lrofman at us.mufg.jp<mailto:lrofman at us.mufg.jp>> wrote:
Hello everybody,

I am DBA and trying to setup systemd service for DB2 V11 fix pack 2a (multiple instances).
Iâ??ve spent quite a bit of time on this setup without success so far.
I was able to get â??ExecStartâ?? part to work, but system reboot is giving me troubles.
DB2 crashes since â??ExecStopâ?? for some reason is not executed.
Please find the contents of db2.service file below.

The help on this is greatly appreciated.

Regards


[Unit]
Description=DB2 StartUp-Shutdown
After=network.target
Before=shutdown.target reboot.target halt.target
Conflicts=shutdown.target

[Service]
Type=forking
RemainAfterExit=yes
User=achdut2
ExecStart=/bin/sh -c '/var/db2/home/achdut2/sqllib/adm/db2start'
ExecStop=/bin/sh -c '/var/db2/home/achdut2/sqllib/adm/db2stop force'
Restart=always
Environment="DB2INSTANCE=achdut2"

[Install]
WantedBy=multi-user.target
________________________________

Please note the MUFG logo and name is a service mark of Mitsubishi UFJ Financial Group, Inc. (â??MUFGâ??) and may be used by it or other Group companies for marketing purposes, including MUFG Americas Holdings Corporation affiliates and subsidiaries. Lending, deposit, securities, investment banking, and other banking services are provided by banking and/or broker-dealer affiliates of MUFG, including, MUFG Bank, Ltd. (â??MUFG Bankâ??), MUFG Union Bank, N.A. (â??Union Bankâ??), MUFG Securities Americas Inc. (â??MUSAâ??), and MUFG Securities (Canada), Ltd. (â??MUS(CAN)â??). MUFG Bank is not an FDIC-insured bank. MUB is an FDIC-insured bank. MUSA is a member of FINRA and SIPC. MUS(CAN) is a member of IIROC and CIPF.

This message is intended for the named addressee(s) only. It may contain confidential, proprietary or legally privileged information. No confidentiality or privilege is waived or lost by any mis-transmission. If you receive this message in error, please delete it and all copies from your system, destroy any hard copies and notify the sender. You must not, directly or indirectly, use, disclose, distribute, print or copy any part of this message if you are not the intended recipient. MUFG, its affiliates and subsidiaries reserve the right to monitor all electronic communications through their respective networks. Any views expressed in this message are those of the individual sender and do not constitute investment advice or recommendation, except where the message expressly states otherwise and the sender is authorized to furnish the same. MUFG (and its subsidiaries) shall (will) not be liable for the message if modified.

_______________________________________________
systemd-devel mailing list
systemd-devel at lists.freedesktop.org<mailto:systemd-devel at lists.freedesktop.org>
https://lists.freedesktop.org/mailman/listinfo/systemd-devel



===================================
Please note the MUFG logo and name is a service mark of Mitsubishi UFJ Financial Group, Inc. (â??MUFGâ??) and may be used by it or other Group companies for marketing purposes, including MUFG Americas Holdings Corporation affiliates and subsidiaries. Lending, deposit, securities, investment banking, and other banking services are provided by banking and/or broker-dealer affiliates of MUFG, including, MUFG Bank, Ltd. (â??MUFG Bankâ??), MUFG Union Bank, N.A. (â??Union Bankâ??), MUFG Securities Americas Inc. (â??MUSAâ??), and MUFG Securities (Canada), Ltd. (â??MUS(CAN)â??). MUFG Bank is not an FDIC-insured bank.  MUB is an FDIC-insured bank. MUSA is a member of FINRA and SIPC.  MUS(CAN) is a member of IIROC and CIPF.

This message is intended for the named addressee(s) only. It may contain confidential, proprietary or legally privileged information. No confidentiality or privilege is waived or lost by any mis-transmission. If you receive this message in error, please delete it and all copies from your system, destroy any hard copies and notify the sender. You must not, directly or indirectly, use, disclose, distribute, print or copy any part of this message if you are not the intended recipient. MUFG, its affiliates and subsidiaries reserve the right to monitor all electronic communications through their respective networks.   Any views expressed in this message are those of the individual sender and do not constitute investment advice or recommendation, except where the message expressly states otherwise and the sender is authorized to furnish the same.  MUFG (and its subsidiaries) shall (will) not be liable for the message if modified.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20180525/0266ae18/attachment-0001.html>


[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux