On the same server, I have a apache php application and a nodejs application (started via systemd).
For systemd/node, I put the following config:
[Service]
EnvironmentFile=/etc/environment
For apache, I have put the following line in /etc/apache2/envvars
. /etc/environment
My problem is:
export
before each variable, but not in node via systemd export
Is there a way for me to write these variables in a single place that can be used by Apache/PHP and node started via systemd ?
You can use the export statement version of your environent file if you change your ExecStart=
line to something like: ExecStart=/bin/sh -c ". /etc/environment && exec /PATH/TO/NODEJS/APPLICATION"
. This is kludgy though.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.