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.
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)
(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.
Personally, I would opt for the normal naming (it's also used in opensuse, fedora and mageia) :/
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.
(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.
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) :@
+*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) +