You are not logged in.
I'm writing a PKGBUILD that will simply place a script in /etc/cron.hourly but I also need to have both /etc/rc.local and /etc/rc.local.shutdown run the script (e.g./etc/cron.d/sync-monitorix.sh). I don't know how to go about modifying these two files via the PKGBUILD. Suggestions are welcomed.
pkgname=monitorix-tmpfs
pkgver=1.0
pkgrel=1
pkgdesc='Simple script to allow monitorix to run in tmpfs and sync data back to your hdd.'
arch=(any)
license=(GPL)
depends=(rsync monitorix)
source=(sync-monitorix.sh)
md5sums=(64573a0f7452b2f68cbd69ba86106d6b)
build() {
install -D sync-monitorix.sh $pkgdir/etc/cron.hourly/sync-monitorix.sh
}
Last edited by graysky (2010-01-30 01:23:19)
CPU-optimized Linux-ck packages @ Repo-ck • AUR packages • Zsh and other configs
Offline
I wouldn't want a PKGBUILD to do that to my /etc/rc.local and /etc/rc.local.shutdown files. Those are my files and PKGBUILDs shouldn't be tampering with them. You'd have to parse them to know where to put your stuff. I don't know if you're even entitled to assume they're bash files (I forget right now whether they're sourced or executed---if the latter they needn't be bash files, right? though I grant they're overwhelmingly likely to be so).
Are you sure you can't do what you want with an /etc/rc.d/your_daemon? If the timing of when daemons start and stop isn't quite right, have a look at the "hooks" in /etc/rc.d/functions. I'm not sure which version of initscripts this shows up in---perhaps it's already in [core], perhaps still in [testing], perhaps only in the initscripts git repository. I haven't kept track. But it's very nice functionality for registering functions to be run at other times than the etc/rc.d/daemons run.
Or, just write a message on install telling users what they need to do to their /etc/rc.local files. And put it in the manpage/docs.
Offline
I don't know how to go about modifying these two files via the PKGBUILD. Suggestions are welcomed.
Please don't do it!
just write a message on install telling users what they need to do to their /etc/rc.local files. And put it in the manpage/docs.
Please do this!
Official Arch packages promise to never overwrite your files. Either your package "owns" the file, or you don't touch it.
...I think. Didn't I read that somewhere?
Offline
Correct.
Offline
I'll echo some text with readme.install, thanks for the tips.
Last edited by graysky (2010-01-30 01:22:31)
CPU-optimized Linux-ck packages @ Repo-ck • AUR packages • Zsh and other configs
Offline