Per Jessen wrote:
I.e. they need an instance name. I've only had reason to run one vpn, so that's openvpn@openvpn, but I frequently run multiple postfix instances - postfix@inst1, postfix@inst2 etc. etc.
Reminds me of my transmission SysV startup scripts, though they had to be separate files /etc/rc.d/transmission & /etc/rc.d/transmission1 due to lack of params that could be passed to the sysV config system (the comments the beginning of the scripts). Basically the provides line -- in one said transmission, in the other transmission1. -- no way to parameterize that for chkconfig & friends, so separate files just for the 1 line. Everything else was based off the instance, but maybe I can steal some ideas from sysd and eventually condense that. Right now working (s.l.o.w.l.y) on a perl script that reads in the sysd config (that part works) -- including parsing and finding all of the types of files in /etc/sysconfig/system and reading in all of the configs for each file (already had a RC/Win-ini config parser w/variable substitution, So could handle primitive rc files including ones that could handle different instances, like this program that talks to both the transmission instances but could define multiple instances w/combo of same and diff args by specifying a [list] of client names after a [clients] section, like: ## .tor_mgrrc [trackers] default='blahka' [blahka] subdom='tracker' dom='blahka.com' port=2710 path="55555555555555555555555555555555/announce.php" [clients] default='trm' list='trm trm1' [trm] addr='localhost:1024' [trm1] addr='localhost:1025' Basically if it found a section followed by a default keyword, it knew it had a multi-instance service. Another rc file (same handler) read:
more .snapperrc [/home] #excludes=space separated list of patterns to exclude #additive string excludes='.recycle/** Bliss/law Bliss/law.V2/** Bliss/athenae/** Bliss/root**' excludes="$excludes CPAN-ishtar-build-cache/**" excludes="$excludes .snapdir/**" excludes="$excludes /home/law/dup-tst-dir/** /home/law/font/[1-8]"
# age = age of snap in integer days w/midnight as cutoff expire='age>32 or' expire="$expire age>24 && day_of_year%8 or" expire="$expire age>16 && day_of_year%4 or" expire="$expire age>8 && day_of_year%2" expire_default='lx' ## list only snap_needed='age>1 or' snap_needed="$snap_needed hour_age>8" and passed the excludes and expires and snap_needed as config options to a program. ---- Basically tried to read rc files in "by section" with everything in a top section, so keys&values are stored by section just like in a Win-ini file. I designed it pre-sysd, but remembered how it worked and it pretty much worked the first time in reading in sysd files & dirs -- if it encountered a file, it called the read-config routine, which automatically read in each key/value by section. Haven't gone beyond reading it in (no validation of config files), but it does validate the tree and filename structures so I can list my sysd stuff by types or by object-names. Ideally will be able to convert chkconfig and friends to use the data-access routines to automatically start services from /etc/rc.d/ or from the sysd config dir so no messages of sysd shadowing sysV files-- will use whatever is there, providing ongoing cross compatibility -- not the easiest nor most exciting tasks, but ultimately the most flexible... The easiest compat solution might just be to run the sysd-db-read routine after any service change and it will recreate a sysV script and ordering to go in /etc/{init,rc}.d I figure if my script can handle dynamic creation of sysV scripts on the fly from sysd scripts, that might be easiest solution. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org