Hi, Where is the systemd service environment set from?
Here is the systemd service env: SHLVL=1 JOURNAL_STREAM=8:30355 PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin INVOCATION_ID=fbd7ba8782544a828902301423a98196 LANG=C PWD=/ How can I set up systemd service to use the root environment set up by /etc/profile? It is not neccesary to set up in my.service file, it can set up in a shell script my.sh called by service file: ExecStart=/usr/bin/my.sh Here is the root environment I login to it, set up in /etc/profile: # env USER=root SYSTEMD_PAGER=cat SHLVL=1 LD_LIBRARY_PATH=/data/lib HOME=/home/root OLDPWD=/data HUSHLOGIN=FALSE PS1=\u@\h:\w\$ LOGNAME=root TERM=xterm PATH=/usr/local/bin:/usr/bin:/bin:/data/bin:/data/sbin:/usr/local/sbin:/usr/sbin:/sbin LANG=C HZ=100 SHELL=/bin/sh PWD=/data/log EDITOR=vi Thank you. - jh
-=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#48567): https://lists.yoctoproject.org/g/yocto/message/48567 Mute This Topic: https://lists.yoctoproject.org/mt/71469798/21656 Group Owner: [email protected] Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub [[email protected]] -=-=-=-=-=-=-=-=-=-=-=-
