Skip to Main Content

Infrastructure Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

systemd boot script for exporting environment variables

raphaelmsxMar 13 2015 — edited Mar 14 2015

Hi people.

I'm using Oracle Linux 7 here, and trying to export some environment variables on a systemd boot script that I created, but it's not working, when I log in as root (or any other user) and test with env command, the variables are not there.

I've created the script in /etc/systemd/system directory and enabled it with systemctl enable myscript.service.


The script itself is working at boot time, I can confirm because there's a last line with this command touch /root/test.txt and in fact it's creating a empty file.

I'm using a simple export MYVARIABLE=test on the script, nothing complicated.

What am I missing here?

Thanks very much.

This post has been answered by Dude! on Mar 13 2015
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 11 2015
Added on Mar 13 2015
4 comments
3,583 views