linuxdeploy icon indicating copy to clipboard operation
linuxdeploy copied to clipboard

cron does not start

Open advgal opened this issue 7 years ago • 6 comments

In my installation, cron does not start. So I added env/include/extra/cron/deploy.conf:

# Linux Deploy Component
NAME="cron"
DESC="Cron daemon"
PARAMS="DISTRIB"
DEPENDS="extra"

env/include/extra/cron/deploy.conf:

# Linux Deploy Component
NAME="cron"
DESC="Cron daemon"
PARAMS="DISTRIB"
DEPENDS="extra"
root@android:/data/data/ru.meefik.linuxdeploy # cat env/include/extra/cron/deploy.sh                                                                                        
#!/bin/sh
# Linux Deploy Component

do_install()
{
    msg ":: Installing ${COMPONENT} not necessary "
}

do_start()
{
    msg -n ":: Starting ${COMPONENT} ... "
    if [ "${METHOD}" = "proot" ]; then
        chroot_exec -u root fakechroot /usr/sbin/cron &
    else
        chroot_exec -u root /usr/sbin/cron
    fi
    is_ok "fail" "done"
    return 0
}

do_stop()
{
    msg -n ":: Stopping ${COMPONENT} not implemented "
    return 0
}

do_status()
{
    msg -n ":: ${COMPONENT} not implemented "
    return 0
}

do_help()
{
cat <<EOF
     cron daemon

EOF
}

and changed in env/config/linux.conf: INCLUDE="bootstrap extra/ssh extra/cron"

All files are in /data/data/ru.meefik.linuxdeploy

Now the cron daemon ist started at startup.

advgal avatar Dec 08 '17 13:12 advgal

Hello and thanks for this post. I am not making any progress with it, I am afraid. So some questions:

I have checked sudo apt-get install cron and I see a report saying I have the most recent installed. Did similar with rsyslog as I thought it might be somehow related. A ps -ef done in a ssh shell shows no cron running although rsyslog is running.

I have tried various ways I have read about to start cron manually but none of them work. So I am stymied...

(a) What linux are you using? I have Ubuntu 14.04 (b) What version of linuxdeploy are you using? I have 1.5.6-192 (c) In my /data/data/ru.meefik.linuxdeploy folder I see the following:

bin etc share

all are folders. But I see no env or similar.

in etc I see a deploy.conf but all there is in it is:

CHROOT_DIR="/data/local/linux" TARGET_PATH="/mnt/sdcard/ubuntu" DISK_SIZE="0" FS_TYPE="auto" TARGET_TYPE="file" DISTRIB="ubuntu" ARCH="armhf" SUITE="trusty" SOURCE_PATH="http://ports.ubuntu.com/" USER_NAME="android" USER_PASSWORD="changeme" SERVER_DNS="" LOCALE="POSIX" DESKTOP_ENV="lxde" USE_COMPONENTS="desktop vnc ssh" STARTUP="ssh vnc custom" CUSTOM_SCRIPTS="/home/android/startHeyu /home/android/startCron" CUSTOM_MOUNTS="/system /mnt/sdcard" SSH_PORT="22" VNC_DISPLAY="0" VNC_DEPTH="16" VNC_DPI="75" VNC_GEOMETRY="1280x672" VNC_ARGS="" XSERVER_DISPLAY="0" XSERVER_HOST="127.0.0.1" FB_DISPLAY="0" FB_DPI="100" FB_DEV="/dev/graphics/fb0" FB_INPUT="/dev/input/event0" FB_ARGS="-sharevts vt0" FB_REFRESH="1" FB_FREEZE="none"

What am I doing wrong here? Thanks!

whitedavidp avatar Apr 01 '18 21:04 whitedavidp

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

VNRARA avatar Apr 25 '19 12:04 VNRARA

i had this in my /data/data/ru.meefik.linuxdeploy/files/config/linux.conf

INIT="sysv"
INIT_ASYNC="false"
INIT_LEVEL="3"
INIT_PATH="/etc/rc.local"
INIT_USER="root"

but it never worked. also tried run-parts.

I fixed it like this now:

INCLUDE="bootstrap extra/ssh init/sysv"

This worked instantly.

LinuxDeploy v2.6.0-259

EugenNY avatar May 25 '20 10:05 EugenNY

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

@VNRARA Do you remember which linux distro and version are you using? I install Arch Linux on LinuxDeploy v2.6.0-259, select sysv as init system, but no luck.

yejianfengblue avatar Oct 26 '23 11:10 yejianfengblue

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

@VNRARA Do you remember which linux distro and version are you using? I install Arch Linux on LinuxDeploy v2.6.0-259, select sysv as init system, but no luck.

It's been 4 years. So haven't got a clue. Probably debian, mint or ubuntu or something.

VNRARA avatar Oct 26 '23 18:10 VNRARA

After fresh install Ubuntu 18.04, start the container, cron may not start. Restart the container, then cron auto starts at boot. Debian should work too. But Arch can't. I can not tell why.

yejianfengblue avatar Nov 17 '23 12:11 yejianfengblue