Archive for the ‘urunner’ Category

urunner 0.2

Sunday, February 1st, 2009

Now with inotify! When available, urunnerd will now use inotify rather than just polling the directory every so often. That means it should generally respond faster to new tasks, and I guess wake up slightly less.

In the event of a task ending from SIGUSR1 (try again later), it will temporarily enter polling mode so the task will be retried soon. When all tasks have completed and been deleted, it reverts back to inotify monitoring.

There are a few other small fixes, scattered about, and it can still be built on non-inotify systems with `make NO_INOTIFY=1`. The same lack of warranty applies, but it does work for me. New tarball is up:

urunner 0.2

An unexpected use for urunner

Saturday, January 31st, 2009

I upgraded to KDE 4.2 yesterday (it is a big improvement; recipes are in the store), and I’ve spent a lot of today playing about with the new and old functions. In the process I managed to freeze plasma a couple of times, so the screen wasn’t responding at all except for the mouse pointer. That meant the usual way of quitting and restarting plasma wouldn’t work. It was much harder to get it to freeze this time than earlier, but just as frustrating to have to kill X and log in again (since I couldn’t run kquitapp etc with nothing responding).

However, I could log in at the console with no issue. From there I could run `urunner <<<”kquitapp plasma && plasma”` and the daemon would restart plasma for me within the session, so it had access to all the usual resources and I avoided having to Ctrl-Alt-Backspace. That was an unintended feature, but it was very handy a few times.

Introducing urunnerd

Tuesday, January 27th, 2009

urunnerd is a daemon for executing tasks within a user session, although the task may have been triggered from outside the session. This is useful for displaying user-visible notifications from a cron job (I have this after my backup job) or from SSH, or for any time you want to have a program run with access to all the resources of the user session. You can start it from your desktop environment’s autostart functionality or xinitrc and forget about the daemon.

The daemon looks for task files in ~/.cache/torun, executes them one at a time with sh and deletes the file afterwards. It also comes with a `urunner` script that reads from stdin and creates a unique task file in the current or a specified user’s directory. Creating the files manually works just fine too, and it skips filenames starting with “.” so you can write the task and move it into place when you’re done.

More details are in the README within the source. On the to-do list is looking into using inotify rather than polling, and probably fixing whatever bugs are assuredly there. I’ve been using it ok for a few days now, but it comes with the usual no warranty and may wreck your stuff (seriously). `make install` will drop it into ~/.local/bin by default, or I’ll be committing a GoboLinux recipe tomorrow.

urunner 0.1

Have at it. Bug reports welcome, patches even more so.