You are not logged in.

#1 2017-07-04 14:46:55

luken
Member
Registered: 2014-06-26
Posts: 37

[SOLVED] Where should I set env vars of libfaketime for apache?

Environmental variables in question are:

export FAKETIME="2017-07-03 21:00:00"
export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1

I have libfaketime installed, and I would like to change time in apache2 for debugging purposes. I tried to put these vars into /usr/sbin/envvars and /usr/sbin/envvars-std but to no vail. Apache doesn't seem to have access to these variables after restarting by using systemd. Where should they be put?

Last edited by luken (2017-07-04 19:26:52)

Offline

#2 2017-07-04 15:13:41

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,572
Website

Re: [SOLVED] Where should I set env vars of libfaketime for apache?

How are you starting apache?  Those just need to be exported from the parent process of whatever is starting the apache server - for debugging, I'd just do this from a shell.  But if you are using httpd.service, you'd need to add an Environment= parameter to the service file.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#3 2017-07-04 19:26:22

luken
Member
Registered: 2014-06-26
Posts: 37

Re: [SOLVED] Where should I set env vars of libfaketime for apache?

Thanks Trilby!
It worked, what I did was creating a file: "/etc/systemd/system/httpd.service.d/override.conf" with a content:

[Service]
Environment="FAKETIME=2017-07-03 21:00:00"
Environment="LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1"

And after reloading systemd and restarting httpd, I had a fake time that I wanted smile .

Last edited by luken (2017-07-04 19:27:36)

Offline

Board footer

Powered by FluxBB