# SLES 15 - How to run script at startup

**URL:** <https://forums.suse.com/t/sles-15-how-to-run-script-at-startup/33048>\
**Category:** SLES Configure-Administer\
**Created:** [October 15, 2018, 10:06pm UTC](https://forums.suse.com/t/sles-15-how-to-run-script-at-startup/33048 "2018-10-15T22:06:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![phrix](https://avatars.discourse-cdn.com/v4/letter/p/d2c977/32.png) [@phrix](https://forums.suse.com/u/phrix)\
**Post date:** [October 15, 2018, 10:06pm UTC](https://forums.suse.com/t/sles-15-how-to-run-script-at-startup/33048/1 "2018-10-15T22:06:22Z")

</div>

Hello,

I am try with Suse Linux Enterprise 15 for upgrade my server, but I don’t find where I run my script of inicialization, befor in SLES 12 I put in /etc/init.d/after.local but this file don’t exist in this version.

Thanks in advanced.

---

<div class="post-metadata">

**Author:** ![malcolmlewis](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/malcolmlewis/32/11375_2.png) [@malcolmlewis](https://forums.suse.com/u/malcolmlewis)\
**Post date:** [October 15, 2018, 11:17pm UTC](https://forums.suse.com/t/sles-15-how-to-run-script-at-startup/33048/2 "2018-10-15T23:17:44Z")

</div>

[QUOTE=phrix;54810]Hello,

I am try with Suse Linux Enterprise 15 for upgrade my server, but I don’t find where I run my script of inicialization, befor in SLES 12 I put in /etc/init.d/after.local but this file don’t exist in this version.

Thanks in advanced.[/QUOTE]  
Hi  
You can create a simple systemd service file pointing at your script in /etc/systemd/system called say script001.service containing;

```auto
# /etc/systemd/system/script001.service
#

[Unit]
Description=Run my boot script

[Service]
Type=oneshot
ExecStart=/bin/sh -c "/path/to/script/scriptname"

[Install]
WantedBy=multi-user.target
```

Once that’s saved, you can run, check and enable;

```auto
systemctl start script001.service
systemctl status script001.service
{if all ok}
systemctl enable script001.service
```

---

<div class="post-metadata">

**Author:** ![phrix](https://avatars.discourse-cdn.com/v4/letter/p/d2c977/32.png) [@phrix](https://forums.suse.com/u/phrix)\
**Post date:** [October 16, 2018, 2:54pm UTC](https://forums.suse.com/t/sles-15-how-to-run-script-at-startup/33048/3 "2018-10-16T14:54:51Z")

</div>

Perfect Malcolm!

Thanks.
