-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cronie doesn't have the proper environment variables set #5510
Comments
Thanks, that should be fixed in 3e2a16f. |
Hmm... I can't actually get to run any cronjobs with this new version. Does it still work for you? |
Ok, will check it. Also need to add Note that crond writes info to syslog. If there issues, you can try to look |
Nothing special in the logcat. It claims it is running the cronjobs but nothing is actually happening. When downgrading to |
@Neo-Oli I have found issue. We have regression in ndk-headers, someone removed patch for Now it picks binaries from /system/bin, but not from $PREFIX/bin. |
Works now, tested with crontab |
@xeffyr I can confirm that it works now. Thanks for looking into this. |
Hi, I am using .bashrc file to put my environment variables and it is not working. What I am missing? |
@Shivam623 You are missing that .bashrc is only for interactive shells. Try to put your variables into ~/.profile or ~/.bash_profile instead. |
Hi @xeffyr , I tried putting in both of the file but it doesn't work on Termux. :( I tried * * * * * printenv>>envlog.text I got all the default variables but not the one I set under ~/.profile or ~/.bash_profile. |
haha! @xeffyr I am on the same page, trying the suggestions. Fingers cross. |
so, * * * * * .$HOME/.profile; python <>/.test.py this worked for me. Finally! Thanks a lot @xeffyr |
Problem description
When a cronjob with cronie is run only the following environment variables are set
Busybox's crond used to just set the enivronment variables that it was started with including the very important
BOOTCLASSPATH
,ANDROID_DATA
,LD_PRELOAD
,$PREFIX
,ANDROID_ROOT
,TZ
andTMPDIR
that some programs, most notably termux-api commands, require to run.Steps to reproduce
Create a cronjob that runs any
termux-api
command liketermux-vibrate
.To get environment variables create a cronjob containing
env > $HOME/environment
and read that file.Expected behavior
The environment variables that termux programs need to run and are set by default should also be set in cronie cronjobs
The text was updated successfully, but these errors were encountered: