Summary: | dev-db/postgresql-server-? - systemd unit should use EnvironmentFile=/etc/conf.d/postgresql-? | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Berthold Humkamp <Timewulf> |
Component: | [OLD] Server | Assignee: | PgSQL Bugs <pgsql-bugs> |
Status: | UNCONFIRMED --- | ||
Severity: | normal | CC: | alex_y_xu, evert.gentoo |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- |
Description
Berthold Humkamp
2014-07-05 17:59:12 UTC
$ head -n 13 /usr/lib/systemd/system/postgresql-9.3.service # It's not recommended to modify this file in-place, because it will be # overwritten during package upgrades. If you want to customize, the # best way is to create file # "/etc/systemd/system/postgresql-9.3.service.d/*.conf" # containing your changes # For example, if you want to change the server's port number to 5433, # create a file named # "/etc/systemd/system/postgresql-9.3.service.d/port.conf" # containing: # [Service] # Environment=PGPORT=5433 # This will override the setting appearing below. Sorry for commenting a closed bug, but I don't know, how to discuss this with you on other channels: I need to edit /etc/conf.d/postgresql-9.3, because there is no other way, to give the new DATA_DIR to the following emerge --config =dev-db/postgresql-server-9.3.3. This creates all initial datafiles of the PostgreSQL-DB and the path cannot be changed later without a lot of problems. There are some possibilities, but those are more dirty tricks than good administration work. All this we can avoid by doing the configuration just before emerge --config ... My idea would be, to put initial parameters into this first config-file (for example: $HOME_DIR and $DATA_PATH) copy them in a first step to /etc/postgresql-9.3/postgresql.conf and use them by reference in all steps later, which means to patch some files like /usr/lib64/systemd/system. Maybe we should use a directory structure more like debian: /etc/postgresql/9.3/ /etc/postgresql/9.4/ In /etc/postgresql/ I would save all parameters which are version independent like $PGUSER and $HOME_DIR, in the subdirectories all version specific parameters like $DATA_DIR, $PORT and so on. I've no experience in creating ebuilds, but I would like to get involved, if you think it's worth to go on. Greetings, Timewulf I'll consider the directory structure change after I look into the impact it will have on some other packages. Work on a patch if you want. I have no interest in systemd. systemd environment should not be mixed with OpenRC (/etc/conf.d/) environment. This is a Gentoo policy (although some packages do not honour this policy yet). In systemd, the sane way to set environment is using Environment=... in - /usr/lib/systemd/system/$service_name.service (package defaults) - /etc/systemd/system/$service_name.service.d/*.conf (user override) My advice: Resolution: INVALID |