Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 485442 - dev-db/mongodb: add systemd unit file
Summary: dev-db/mongodb: add systemd unit file
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo systemd Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: install-systemd-unit
  Show dependency tree
 
Reported: 2013-09-19 19:34 UTC by Peter Volkov (RETIRED)
Modified: 2013-09-28 11:41 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
mongodb@.service (mongodb@.service,293 bytes, text/plain)
2013-09-19 19:34 UTC, Peter Volkov (RETIRED)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Volkov (RETIRED) gentoo-dev 2013-09-19 19:34:39 UTC
Created attachment 359052 [details]
mongodb@.service

Attached is a template unit file. To start mongod you'll need to create custom configuration file in /etc/monogdb/. I suggest to use

https://projects.archlinux.org/svntogit/community.git/plain/trunk/mongodb.conf?h=packages/mongodb

as a "default" configuration (/etc/mongodb/mongodb.conf. I decided to opt-out most command line options we currently use in init.d and put them in config file.

Please, add it to the tree.
Comment 1 Pacho Ramos gentoo-dev 2013-09-19 20:00:50 UTC
Why do you want to only provide a template unit instead of a normal one? I only see normal ones in other distributions
https://projects.archlinux.org/svntogit/community.git/tree/trunk/mongodb.service?h=packages/mongodb
(for example)
Comment 2 Peter Volkov (RETIRED) gentoo-dev 2013-09-25 09:28:57 UTC
(In reply to Pacho Ramos from comment #1)
> Why do you want to only provide a template unit instead of a normal one?

Well, this is just personal convenience as I wanted multiple mongodb instances running in parallel. But I think this is mostly development configuration. So I don't see a big problem if we'll have normal unit file, like in archlinux. That said, note, that we'll need /etc/mongodb.conf file then.
Comment 3 Pacho Ramos gentoo-dev 2013-09-25 21:26:45 UTC
Personally, I would opt for the normal naming (it's also used in opensuse, fedora and mageia) :/
Comment 4 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2013-09-25 22:58:15 UTC
Inventing new config file locations and confusing @ units for personal convenience is something you should do locally. Users aren't really supposed to guess what should go after the '@', and where they should place the config file afterwards.

Just provide a simple 'mongodb.service' with proper config-file location. If someone needs multiple instances, systemd makes inheriting and extending services easy enough.
Comment 5 Peter Volkov (RETIRED) gentoo-dev 2013-09-26 11:32:57 UTC
(In reply to Michał Górny from comment #4)
> Inventing new config file locations ...

/etc/<servicename>/ is a standard location in Gentoo.

> Users aren't really supposed to guess what should go after the '@', and where
> they should place the config file afterwards.

How the are supposed to know this for other cases:

autovt@.service             mongodb@.service       sshd@.service            wpa_supplicant@.service
configure-printer@.service  openvpn@.service       systemd-fsck@.service
getty@.service              serial-getty@.service  systemd-nspawn@.service
hplip-printer@.service      smbd@.service          user@.service

?

That said, I already agreed that normal naming is Ok for now.
Comment 6 Pacho Ramos gentoo-dev 2013-09-28 10:51:16 UTC
Was trying to use:
https://projects.archlinux.org/svntogit/community.git/plain/trunk/mongodb.service?h=packages/mongodb

but this requires old v8 version (that blocks chromium) :@
Comment 7 Pacho Ramos gentoo-dev 2013-09-28 11:41:02 UTC
+*mongodb-2.4.6-r1 (28 Sep 2013)
+
+  28 Sep 2013; Pacho Ramos <pacho@gentoo.org> +files/mongodb.conf,
+  +files/mongodb.service, +mongodb-2.4.6-r1.ebuild:
+  Add unit file (#485442 by Peter Volkov)
+