Skip to main content
Topic: [SOLVED] mongodb (Read 1322 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

[SOLVED] mongodb

I have a working artix-lxde-runit system after migration from Arch linux.  I have a number of issues related to software which i don't think I can yet install.

One of these is mongodb-bin which is an archlinux AUR package derived from  deb files provided at https://repo.mongodb.org/apt; however as with so many they assume that we have systemd etc etc. I would like advice on how to go about converting the PKGBUILD into something that can be used with runit.

Effectively I think that means I have to deal with

  install -Dm644 "$srcdir/mongodb_${CARCH}.service" "$pkgdir/usr/lib/systemd/system/mongodb.service"
  install -Dm644 "$srcdir/mongodb.sysusers" "$pkgdir/usr/lib/sysusers.d/mongodb.conf"
  install -Dm644 "$srcdir/mongodb.tmpfiles" "$pkgdir/usr/lib/tmpfiles.d/mongodb.conf"

I have some experience with runit so can probably make up a runit file to start mongodb.

I think I can understand sysUsers & tmpfiles, but how when do I act on it. I see there are two binaries systemd-sysusers and systemd-tmpfiles. Should I use those  on the filesinstead of installing?

Any advice welcome; if someone has already done this I would be glad to try out. Also assuming I eventually arrive at a working PKGBUILD, what should I do with it ie is there some place it can be published for others to use?

EDIT: I created an AUR for the runit script here https://aur.archlinux.org/packages/mongodb-runit/

Re: mongodb

Reply #1
install -Dm644 "$srcdir/mongodb_${CARCH}.service" "$pkgdir/usr/lib/systemd/system/mongodb.service"
  install -Dm644 "$srcdir/mongodb.sysusers" "$pkgdir/usr/lib/sysusers.d/mongodb.conf"
  install -Dm644 "$srcdir/mongodb.tmpfiles" "$pkgdir/usr/lib/tmpfiles.d/mongodb.conf"
Only the first line needs to be deleted. The tmpfiles and sysusers are taken care by the respective stand-alone packages in Artix.
A separate PKGBUILD (or a split one) should be created for the init script, i.e. mongodb-openrc etc. There's already one for openrc at the Gentoo repository.
The AUR is the place to upload non-repo packages.

Re: mongodb

Reply #2
Thanks for the info; I suppose the run_sysinit in the boot process causes the .sysusers & .tmpfiles things to be inspected.

A couple of questions; what should I call the AUR package; I suppose mongodb-bin-artix might cause some anger. In the past I have used -nosystemd as a suffix, but that's not really true if we use the .sysusers and .tmpfiles; how about mongodb-bin-noservice or similar?

Presumably I can create a fairly simple mongodb-bin-runit PKGBUILD eg

#!/bin/sh
[ ! -e /etc/mongodb.conf ] && exit 1
exec /usr/bin/chpst -u mongodb:daemon /usr/bin/mongod --quiet --config /etc/mongodb.conf

I looked at various artix run scripts, but didn't see much usage of chpst.

Re: mongodb

Reply #3
please do not put any artix-related PKGBUILDs in AUR. The AUR must remain for archlinux

Re: mongodb

Reply #4
There are dozens of openrc, runit and s6 service scripts on the AUR already and they are not Artix-specific.

On the other hand, please don't use artix in the package name, except if it's something that it originated in Artix (like artix-dark-theme which is indeed on the AUR). For mongodb-bin itself, I see no reason to change its pkgname at all for such a trivial matter as the removal of a systemd service. For future reference, the norm for packages not linking against the systemd octopus is pkgname-nosystemd.

Re: mongodb

Reply #5
I cannot use the mongdb-bin name as it is already used for the existing AUR package which does install a service file.

If installing a systemd service is not considered to be a problem then I can just produce a mongodb-runit  with no requirements.

mongodb-bin provides mongodb=4.2.2 and it seems init packages either have to be installed without requirements or they have to be altered every time the mongdb-bin version changes. An alternative is to just check that /bin/mongod is present.