Skip to Main Content

Infrastructure Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Oracle Linux 7.1 systemctl not stopping services by init 6

DurmicOct 13 2016 — edited Oct 15 2016

Hi,

I'm having a strange problem with systemcl.

My configuration in /lib/systemd/system/test.service looks like this:

[Unit]

Description=MY Test Service

After=syslog.target network.target

[Service]

# systemd ignores PAM limits, so set any necessary limits in the service.

# # Not really a bug, but a feature.

# # https://bugzilla.redhat.com/show_bug.cgi?id=754285

# LimitMEMLOCK=infinity

# LimitNOFILE=65535

#

Type=simple

RemainAfterExit=yes

User=root

Group=root

ExecStart= /usr/bin/echo "Starting Test Service"

ExecStop= /usr/bin/echo "Stopping Test Service"

[Install]

WantedBy=multi-user.target

I have also enabled this services with:

# ln -s /lib/systemd/system/test.service /etc/systemd/system/test.service

# systemctl daemon-reload

# systemctl start test.service

# systemctl enable test.service

If I than run systemctl start test.service and systemctl stop test.service I get what i want. My services are stopped and started without any problems.

The Problem happens after restarting  the server. After reboot the service is started, but before shutting down, the service had to stop first. This is not happening.

Any idea why is this not working?

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 12 2016
Added on Oct 13 2016
1 comment
756 views