# \[QPKG\] RunLast

**URL:** <https://community.qnap.com/t/qpkg-runlast/1102>\
**Category:** General\
**Tags:** qts, qpkg, startup, automation\
**Created:** [April 26, 2025, 11:33pm UTC](https://community.qnap.com/t/qpkg-runlast/1102 "2025-04-26T23:33:27Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![OneCD](https://community.qnap.com/user_avatar/community.qnap.com/onecd/32/156_2.png) [@OneCD](https://community.qnap.com/u/OneCD)\
**Post date:** [April 26, 2025, 11:33pm UTC](https://community.qnap.com/t/qpkg-runlast/1102/1 "2025-04-26T23:33:27Z")

</div>

![](https://cdn-community.qnap.com/original/2X/f/f430f24aff68f8c409416d9d0932501637536523.png)

Description

RunLast creates an environment to run commands or shell-scripts after QPKG re-integration has occurred during QTS NAS bootup.

This allows you to run scripts dependent on QPKGs during QTS startup.

What it does

This package creates a scripts directory in the package installation path:

- `init.d`

- `scripts`

Place your SysV-style scripts in the init.d directory. These will be executed with a start parameter after NAS startup, and with a stop parameter before NAS shutdown. Scripts in the scripts directory will be executed only during startup, and always after the custom init.d start script execution.

Installation

- Available in the **[MyQNAP repo](https://www.myqnap.org/product/runlast)**, and can also be installed via the **[sherpa](https://github.com/OneCDOnly/sherpa)** package manager.

Notes

- When this package is installed, there’s not much to see. Find the package icon and click the ‘Open’ button to display the current log file - any stdout and stderr from your scripts will be shown here.

- The log file is viewable via your web browser but is not a real web document, so it can change without your browser noticing. Whenever viewing the log, ensure you force a page refresh: CTRL+F5.

- To jump to the scripts directory:

```auto
cd $(getcfg RunLast Scripts_Path -f /etc/config/qpkg.conf)
```

- Or, to jump to the init.d directory:

```auto
cd $(getcfg RunLast SysV_Path -f /etc/config/qpkg.conf)
```

- The source for this project can be found on [GitHub](https://onecdonly.github.io/RunLast/).

- **[Changelog](https://raw.githubusercontent.com/OneCDOnly/RunLast/master/changelog.txt)**

---

<div class="post-metadata">

**Author:** ![mandragor59](https://avatars.discourse-cdn.com/v4/letter/m/51bf81/32.png) [@mandragor59](https://community.qnap.com/u/mandragor59)\
**Post date:** [July 2, 2025, 1:39pm UTC](https://community.qnap.com/t/qpkg-runlast/1102/2 "2025-07-02T13:39:46Z")

</div>

Please do not stop developing “RunLast", please !. And don’t make it worse than it is! It already follows the right approach, especially because of the nice structure of the SysV start scripts. You can get almost anything to run with it if the user considers the dependencies of his application on other QPKG’s and steals a little from their start scripts. You should mention that and point it out!  
I Think “RunLast” is feature enough in implementing a custom start- and stop-environment to QNAP-Devices

Maybe you can think of something in the future that allows you to generate your own dependency key from all installed, active QPKGs when starting.

… and a wooden spoon as an icon, seriously?

Best regards,

Mandragor59

\*\*\*\*\* There are no problems, there are only challenges \*\*\*\*\*

…

---

<div class="post-metadata">

**Author:** ![OneCD](https://community.qnap.com/user_avatar/community.qnap.com/onecd/32/156_2.png) [@OneCD](https://community.qnap.com/u/OneCD)\
**Post date:** [July 2, 2025, 9:39pm UTC](https://community.qnap.com/t/qpkg-runlast/1102/3 "2025-07-02T21:39:56Z")

</div>

> [@mandragor59](#):
>
> Please do not stop developing “RunLast", please !. And don’t make it worse than it is! It already follows the right approach, especially because of the nice structure of the SysV start scripts.

Thank you for the back-handed compliment. 😉

> [@mandragor59](#):
>
> Maybe you can think of something in the future that allows you to generate your own dependency key from all installed, active QPKGs when starting.

[Already tried it](https://forum.qnap.com/viewtopic.php?p=867196#p867196). Unfortunately, QTS stalls when attempting to load a dependency key with more than a handful of values.

> [@mandragor59](#):
>
> … and a wooden spoon as an icon, seriously?

Yes, you understand the reference right? Besides, you had your chance to [suggest something better](https://forum.qnap.com/viewtopic.php?t=144875). 😁

I’ve been considering adding support for QTS 5.2.0 and-later by getting RunLast to wait for the QTS QPKG init proc to exit. When it does, then assume all QPKGs are started and run the user-scripts.

I’ll do some work on this and see how reliable it is. Maybe RunLast can be resumed?

---

<div class="post-metadata">

**Author:** ![mandragor59](https://avatars.discourse-cdn.com/v4/letter/m/51bf81/32.png) [@mandragor59](https://community.qnap.com/u/mandragor59)\
**Post date:** [July 3, 2025, 1:31pm UTC](https://community.qnap.com/t/qpkg-runlast/1102/4 "2025-07-03T13:31:34Z")

</div>

> [@OneCD](#):
>
> I’ll do some work on this and see how reliable it is. Maybe RunLast can be resumed?

Please do it! Absolutely ! In any case ! They will love you for it!

> [@OneCD](#):
>
> If you’re running QTS 5.2.0 or-later, you can uninstall RunLast. However, this package will continue to be maintained for those running older QTS versions.

… and maybe you consider to make your “description” not so negative and ask for uninstallation right away ! Maybe you better add a note that in QTS 5.2.0 or later you have to consider the dependencies to the required QPKG’s in the start scripts (at the moment).

\*\*\*\*\* There are no problems, only challenges \*\*\*\*\*  
…

---

<div class="post-metadata">

**Author:** ![mandragor59](https://avatars.discourse-cdn.com/v4/letter/m/51bf81/32.png) [@mandragor59](https://community.qnap.com/u/mandragor59)\
**Post date:** [July 3, 2025, 1:32pm UTC](https://community.qnap.com/t/qpkg-runlast/1102/5 "2025-07-03T13:32:18Z")

</div>

> [@OneCD](#):
>
> Yes, you understand the reference right? Besides, you had your chance to [suggest something better](https://forum.qnap.com/viewtopic.php?t=144875). 😁

Well, not really. The only reference I can think of as an amateur cook to my wooden spoon is that it doesn’t fit in my mouth. Perhaps you can enlighten an older German user. I would (if asked again) rather choose a medal or a winner’s trophy with the inscription “Last Place”. 🕶

---

<div class="post-metadata">

**Author:** ![OneCD](https://community.qnap.com/user_avatar/community.qnap.com/onecd/32/156_2.png) [@OneCD](https://community.qnap.com/u/OneCD)\
**Post date:** [July 3, 2025, 9:44pm UTC](https://community.qnap.com/t/qpkg-runlast/1102/6 "2025-07-03T21:44:04Z")

</div>

> [@mandragor59](#):
>
> … and maybe you consider to make your “description” not so negative and ask for uninstallation right away !

I like to set expectations low, right from the outset. 😬

> [@mandragor59](#):
>
> Maybe you better add a note that in QTS 5.2.0 or later you have to consider the dependencies to the required QPKG’s in the start scripts (at the moment).

There’s already a note in the OP about this.

> [@mandragor59](#):
>
> Well, not really. The only reference I can think of as an amateur cook to my wooden spoon is that it doesn’t fit in my mouth. Perhaps you can enlighten an older German user. I would (if asked again) rather choose a medal or a winner’s trophy with the inscription “Last Place”

In various countries (such as mine with a strong sports culture), the [“wooden spoon award”](https://en.wikipedia.org/wiki/Wooden_spoon_(award)) is given to a sports team that comes dead-last each year. It’s not a real award. 😉

---

<div class="post-metadata">

**Author:** ![OneCD](https://community.qnap.com/user_avatar/community.qnap.com/onecd/32/156_2.png) [@OneCD](https://community.qnap.com/u/OneCD)\
**Post date:** [July 7, 2025, 4:03am UTC](https://community.qnap.com/t/qpkg-runlast/1102/7 "2025-07-07T04:03:43Z")

</div>

**RunLast** is now available through **sherpa** for QTS 5.2.0 and-later. 🤓

I’ll submit the updated version (250707) to the MyQNAP repo shortly.

---

<div class="post-metadata">

**Author:** ![DLS4BZ](https://avatars.discourse-cdn.com/v4/letter/d/b5e925/32.png) [@DLS4BZ](https://community.qnap.com/u/DLS4BZ)\
**Post date:** [March 4, 2026, 5:34am UTC](https://community.qnap.com/t/qpkg-runlast/1102/8 "2026-03-04T05:34:43Z")

</div>

Hi

Sorry for bumping this old (ish) thread, but i wanted to ask if it’s possible, with your app, to do what i’m triyng to do lol.

So i have mktorrent on my qnap from github.

Now, i want to execute the make command every time on restart, because the program is not persistent.

is it possible to do this with this tool? Because every time i try i get an error saying “make - command not found”. I have make installed through opkg and it works.

I have to add that i’m very new to scripting, i’d like to use bash for this. But if there’s a better alternative to do this i’m all ears.

Any help is greatly appreciated.

---

<div class="post-metadata">

**Author:** ![OneCD](https://community.qnap.com/user_avatar/community.qnap.com/onecd/32/156_2.png) [@OneCD](https://community.qnap.com/u/OneCD)\
**Post date:** [March 4, 2026, 6:03am UTC](https://community.qnap.com/t/qpkg-runlast/1102/9 "2026-03-04T06:03:04Z")

</div>

Hi @DLS4BZ and welcome to the forum. 🙂

If your script uses packages installed through Entware (and `opkg`), suggest using the Entware init system to launch your script instead of RunLast. What you want can be done with RunLast, but might be done better in Entware.

Place your executable startup script in `/opt/etc/init.d/` and ensure the script filename starts with an uppercase ‘S’. Your script will now run automatically after Entware has been started.

---

<div class="post-metadata">

**Author:** ![DLS4BZ](https://avatars.discourse-cdn.com/v4/letter/d/b5e925/32.png) [@DLS4BZ](https://community.qnap.com/u/DLS4BZ)\
**Post date:** [March 4, 2026, 11:22am UTC](https://community.qnap.com/t/qpkg-runlast/1102/10 "2026-03-04T11:22:00Z")

</div>

Thanks for your help, it finally worked!
