DB-Based Kannel Box for message queueing This is a plugin for app-mobile/kannel that allows storing messages (sent and queued) in a database. The tricky part is integrating with the kannel ebuild startup script as sqlbox needs to start after bearerbox but before sms box. I have some modified conf.d and init.d files for kannel that easily facilitated this behavior, but collaboration would need to take place between the 2 apps. Reproducible: Always
Created attachment 204366 [details] sqlbox-0.7.2.ebuild
Created attachment 204368 [details] sqlbox-0.7.2-sqlinit-hfiles.patch
There are 2 ways of dealing with initd inter-dependencies: 1) break kannel initd in 3 scripts (bearerbox, smsbox and wapbox). The sqlbox will have "use bearerbox" and "before smsbox". 2) include sqlbox support within kannel ebuild through a local USE flag. What do you think is best?
s/use bearerbox/need bearerbox/ ... duh
(In reply to comment #3) > There are 2 ways of dealing with initd inter-dependencies: > 1) break kannel initd in 3 scripts (bearerbox, smsbox and wapbox). The sqlbox > will have "use bearerbox" and "before smsbox". > 2) include sqlbox support within kannel ebuild through a local USE flag. > > What do you think is best? > Easiest for 'normal' users would be a single ebuild. However, since smsbox, wapbox, and sqlbox can all run without a local bearerbox it's probably 'correct' to have multiple init scripts. Even that gets tricky though because (I'm ignorant to the details of the init deps) sqlbox doesn't necessarily need or use local beaerbox...nor is sqlbox neccesarily connected to via a local smsbox. I'm guessing putting each in it's own init and have conf.d options to say if necessary services are local or not and then dynamically set {use,before,etc} based off the conf.d option(s)? Not sure if that's possible, but it's an idea.
Imported in tree as app-mobilephone/kannel-sqlbox. I tried to unify kannel and sqlbox, but I realized it would make my life a lot harder. app-mobilephone/kannel now installs 3 init scripts: kannel-{bearerbox,smsbox,wapbox}. kannel-smsbox and kannel-wapbox initd scripts have "need kannel-bearerbox". kannel-sqlbox have "need kannel-bearerbox" and "before kannel-smsbox". I know it might not be required to run bearerbox on the same machine as the rest of the services, but at least baselayout-1.19 fails to find the right dependencies for "/etc/init.d/kannel-bearerbox stop" when other services had "use kannel-bearerbox". Since most peeps will run all these services on the same machine, I decided to use "need" iso "use".
I finally got around to testing this out. Thanks for helping out with this and getting sqlbox added to the tree! The only suggestion I have is to add.. use kannel-sqlbox to kannel-smsbox init script. Not really a big deal though. Thanks again for the help!
(In reply to comment #7) I cannot do that, kannel-sqlbox service is optional! "before kannel-smsbox" kannel-sqlbox's dependency is the only way to start services in the right order without breaking the standard scenario (the one without kannel-sqlbox service).
Mabye baselayout 1 is different but for me a use <whatever> doesn't affect anything if it's not installed and added to a runlevel. In other words, I don't see how this would affect the smsbox script if sqlbox is not installed and/or the script is not added to a runlevel.
"use" represents a mandatory dependency. If you put "use foo" and foo doesn't exist, I would expect to see at least a warning about it.