![]() |
[Announce] Dbuscron - the cron-like DBUS scheduler
Hello, all!
I was missing for simple dbus scheduler for a long time (dbus-scripts is a no op for me for some reasons), so I created my own dbuscron daemon to monitor DBUS events and run commands on them. The source code lies on github at http://github.com/kstep/dbuscron and deb-package can be taken from my blog at http://kstep.me/dbuscron_en.html. The main idea of the scheduler is simple: it's just like good old cron but for DBUS messages. It's configured with /etc/dbuscrontab file in a crontab-like format. Here're some simple examples from my own config: Code:
# bus(*S*ystem/*s*session) message_type(signal|method_call|method_return|error) source interface object_path member destination arguments command As of stability, I run it on my N900 all the time for several weeks and haven't mentioned any critical bugs (and if I do, I will not wait to fix them asap, as I'm the main user of this program). P.S. If you are interested in some of my scripts mentioned in this example, I can provide them as well (except private parts with passwords etc. of cause =). |
Re: [Announce] Dbuscron - the cron-like DBUS scheduler
On similarity to dbus-scripts I want to mention the following points:
+ the command can be not only single script name w/o spaces, it can be any arbitrary string, include spaces and different shell-orientent expressions etc., + it can listen to both session & system buses at the same time (which is critical to me), + it can (hopefully) run without run-standalone.sh, + it provides full DBUS message info to script in environment variables, + arguments are matched as strings, and they are converted to them in a quite smart way, so you can match even bools ('1' for true and '0'), arrays as '1,2,3' or dicts as 'a:1,b:2,c:3' (well, there's still small bug in it I will target in closest release, but it's a really quick and easy fix), + any scripts written for dbus-scripts, are already compatible with dbuscron, just use "scriptname $DBUS_ARG0 $DBUS_ARG1 $DBUS_ARG2" as command in dbuscrontab, or replace $1,$2,... in script with $DBUS_ARG0,$DBUS_ARG1,..., - it doesn't match rules with fnmatch(), but with simple string comparison, so no wildcards (except for '*', which is not wildcard exactly), but it is in my todo list. |
Re: [Announce] Dbuscron - the cron-like DBUS scheduler
BTW, I'm in garage now at https://garage.maemo.org/projects/dbuscron/ and version 1.4 is out. Changelog:
bus: interface to set custom session bus --sessionaddr option to set custom session bus address parser: fixed typo support \xXX escape characters in args field parser: fix bug in syntax checker on starred fields genchangelog: indent shortlog correctly run dbuscron as user support \uXXXX as well as \xXX in args field Makefile: better compilation |
Re: [Announce] Dbuscron - the cron-like DBUS scheduler
Good stuff.
|
Re: [Announce] Dbuscron - the cron-like DBUS scheduler
Sounds nice.
You thought about some support scripts that will import and convert existing dbus-scripts settings? might be useful, as I'd not want to run both daemons concurrently, but rather migrate from dbus-scripts to Dbuscron. Please give clear instructions how to install your program, so users don't need to figure out by themselves. Many thanks, keep hacking :-) /jOERG |
Re: [Announce] Dbuscron - the cron-like DBUS scheduler
Having a configuration directory in addition to (or instead of) a configuration file is essential for allowing other programs to easily use this daemon. I hope you plan to add this feature.
|
Re: [Announce] Dbuscron - the cron-like DBUS scheduler
Thank you all to your comments. I will put your ideas on my todo list.
|
Re: [Announce] Dbuscron - the cron-like DBUS scheduler
New 1.5 release.
Release notes: https://garage.maemo.org/frs/shownot...elease_id=4337 Download from: https://garage.maemo.org/frs/?group_id=2007 Please read release notes carefully. I have implemented ideas of all people in this thread. |
Re: [Announce] Dbuscron - the cron-like DBUS scheduler
I have petitioned for extras-devel upload account and now am waiting for approvement. When I got it, I will put dbuscron into extras-devel, so it can be installed via application manager. For now you can download it from my garage account and install either by opening deb-package with application manager or via command line:
$ sudo gainroot # dpkg -i path/to/package/dbuscron_1.5-1_all.deb |
Re: [Announce] Dbuscron - the cron-like DBUS scheduler
If you like and use my dbuscron, please consider voting for it at my ohloh page (if it's not very difficult and time consuming for you, of cause):
https://www.ohloh.net/p/dbuscron Thank you in advance! |
All times are GMT. The time now is 03:34. |
vBulletin® Version 3.8.8