meefik / linuxdeploy

Install and run GNU/Linux on Android
https://meefik.github.io/linuxdeploy
GNU General Public License v3.0
5.19k stars 678 forks source link

Cron not work #669

Open p9ablo opened 7 years ago

p9ablo commented 7 years ago

Hello I have Ubuntu running on android device with linux deploy (chroot enviroment) Ubuntu 14.04 LTS [running via Linux Deploy]

ps aux | grep cron

I get this:

android 3101 0.0 0.0 1700 460 pts/0 S+ 12:15 0:00 grep --color=auto cron

But task with crontab -e and with sudo crontab -e not working. If I execute this

sudo /usr/sbin/cron

Then my jobs on cron are executed and with ps aux | grep cron I have

root      3793  0.0  0.0   2260   788 ?        Ss   12:37   0:00 /usr/sbin/cron
android   3795  0.0  0.0   1700   460 pts/0    S+   12:37   0:00 grep --color=auto cron

But I can't run /usr/sbin/cron auto at start. Executing sudo service cron start return.

 Rather than invoking init scripts through /etc/init.d, use the service(8)
utility, e.g. service cron start

Since the script you are attempting to invoke has been converted to an
Upstart job, you may also use the start(8) utility, e.g. start cron

What I can do? I have cron on /etc/init.d/

advgal commented 6 years ago

I have the same problem, I added

/etc/init.d/cron start

to /etc/rc.local, but it still dont works.

Any solutions?

whitedavidp commented 6 years ago

Me too. I am stumped. I had this working some time ago but discovered today that cron is NOT running and trying to issue either

service cron start

I get

Rather than invoking init scripts through /etc/init.d, use the service(8) utility, e.g. service cron start

Since the script you are attempting to invoke has been converted to an Upstart job, you may also use the start(8) utility, e.g. start cron

If I try "upstart" via

start cron

I get no response but no cron process is seen in ps -ef | grep cron

MasterPlexus commented 6 years ago

I've the same problem under Debian. Cron is not starting automatically, must be started manually.

whitedavidp commented 6 years ago

Yes, still not working for me. I have had no success with anything and have no idea why. But I am not a linux expert by any means. Will certainly entertain suggestions.

MasterPlexus commented 6 years ago

Check in the settings of your mashine in deploy Linux what is set in the init area. In my Maschine run-parts was chosen, whicht not start all services. Switching to sysv solved the problem for me (I guess the setting is dependent to your distribution you have chosen, also other could be possible there as a selection)

whitedavidp commented 6 years ago

Hi and thanks very much for the response and help. Wow! I am missing something. I have checked both the settings for LinuxDeploy over all AND those for my deployed Unbuntu Trusty install. I am pretty sure you are talking about the latter, And I see nothing at all even remotely like an init section/area. I see headings of "Actions", "Deploy", and "Startup". I would guess that init stuff would be in Startup. But I see nothing at all even close to what you describe. I am on version 1.5.6-192 of this app. This is an Android TV computer box (Minix Neo X5) with Android 4.2.2. Thanks!

MasterPlexus commented 6 years ago

I'm on 2.0.6-234, so may there is also a differ for the settings... Mine was found in settings of my distribution under the heading init, an is called init settings.

p9ablo commented 6 years ago

My solution was enable init scripts on linuxdeploy settings and starting cron on rc.local. I can't xplain more becasue it was long time ago.

whitedavidp commented 6 years ago

After much trial and no success, I have given up on using cron to do this. Instead, I am using Tasker on the Android side to launch my cron job scripts. Crude and less clean than using cron. But I seem to have no other alternative. Thanks to meefik for having the ability to launch linux deploy shell scripts from the Android command line!

necan commented 6 years ago

I tried manually start cron, but it's still not working. I have to give up it.

$ sudo service cron start
 * Starting periodic command scheduler cron

$ service cron status
 * cron is not running
nitsoh commented 5 years ago

@whitedavidp Can you please give me some instructions on how to launch linux deploy shell scripts from the Android command line?

whitedavidp commented 5 years ago

On my device I am doing this: /data/data/ru.meefik.linuxdeploy/files/bin/linuxdeploy shell -u android /home/android/annualUpdate.sh;exit

nitsoh commented 5 years ago

@whitedavidp Thank you so much for your help!

VNRARA commented 5 years ago

In Linux Deploy settings: set init system to sysv and enable it. Cron should work now with every boot.