# issues with start/shutdown scripts

**URL:** https://forums.suse.com/t/issues-with-start-shutdown-scripts/29812
**Category:** SLES Configure-Administer
**Created:** [May 18, 2017, 10:29pm UTC](https://forums.suse.com/t/issues-with-start-shutdown-scripts/29812 "2017-05-18T22:29:38Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![skunkboy](https://avatars.discourse-cdn.com/v4/letter/s/df788c/32.png) [@skunkboy](https://forums.suse.com/u/skunkboy)
#### Post date: [May 18, 2017, 10:29pm UTC](https://forums.suse.com/t/issues-with-start-shutdown-scripts/29812/1 "2017-05-18T22:29:38Z")

</div>

Since I can’t find any useful documentation on how to write shutdown/startup scripts for systemd itself, still using the following in scripts

### BEGIN INIT INFO

# Provides: somedaemon

# Required-Start:

# Required-Stop:

# Default-Start: 3 5

# Default-Stop: 0 1 6

# Description:

### END INIT INFO

Startup works fine after place somedaemon script into /etc/init.d and executing : systemctl enable somedaemon ; systemctl start somedaemon  
shutdown execution does not seem to work so well, in face it isn’t getting shutdown. Is there something simple I’m missing?

Thanks,  
matt

---

<div class="post-metadata">

### Author: ![ab1](https://avatars.discourse-cdn.com/v4/letter/a/d2c977/32.png) [@ab1](https://forums.suse.com/u/ab1)
#### Post date: [May 18, 2017, 11:14pm UTC](https://forums.suse.com/t/issues-with-start-shutdown-scripts/29812/2 "2017-05-18T23:14:31Z")

</div>

On 05/18/2017 01:34 PM, skunkboy wrote:[color=blue]

> Since I can’t find any useful documentation on how to write  
> shutdown/startup scripts for systemd itself, still using the following  
> in scripts[/color]

What documentation have you found? What have you tried? In general the  
service unit files are fairly simple; I worked through docs and examples a  
couple years ago and found it pretty straight-forward, but since then I’ve  
found I was lucky and that, like anything, it can depend on the scenario.  
Knowing how your ‘somedaemon’ thing works is probably useful, as it  
understanding its startup properly.  
[color=blue]

> ### BEGIN INIT INFO
> 
> # Provides: somedaemon
> 
> # Required-Start:
> 
> # Required-Stop:
> 
> # Default-Start: 3 5
> 
> # Default-Stop: 0 1 6
> 
> # Description:
> 
> ### END INIT INFO[/color]

I presume this daemon does not have any service/system dependencies, so  
that’s interesting, and probably not something I’d emulate. Most services  
I’ve seen at least have something like $local\_fs or $network in there.  
[color=blue]

> Startup works fine after place somedaemon script into /etc/init.d and  
> executing : systemctl enable somedaemon ; systemctl start somedaemon  
> shutdown execution does not seem to work so well, in face it isn’t  
> getting shutdown. Is there something simple I’m missing?[/color]

Care to share the output from your shutdown attempt? I presume you are  
using ‘stop’ and not ‘shutdown’ for the service.

Also, one of the benefits of systemd is great logging of what happens when  
a service tires to do something. What does the following show:

[CODE[  
systemctl status somedaemon  
[/CODE]

–  
Good luck.

If you find this post helpful and are logged into the web interface,  
show your appreciation and click on the star below.

If you want to send me a private message, please let me know in the  
forum as I do not use the web interface often.

---

<div class="post-metadata">

### Author: ![skunkboy](https://avatars.discourse-cdn.com/v4/letter/s/df788c/32.png) [@skunkboy](https://forums.suse.com/u/skunkboy)
#### Post date: [May 22, 2017, 9:53pm UTC](https://forums.suse.com/t/issues-with-start-shutdown-scripts/29812/3 "2017-05-22T21:53:41Z")

</div>

I left it generic and didn’t fill in any details. Our oracle dbas say it is working now?

Anyways thanks for the response 🙂

Matt
