Job Scheduler problem

Report Bugs, Issues and non- package Requests
Message
Author
User avatar
jeffreyC
Posts: 537
Joined: Mon May 27, 2019 10:39 am

Job Scheduler problem

#1 Post by jeffreyC »

After noticing that one of the two conkies I have running on my MX-21 desktop was filling up my RAM as time passed I thought to set up a scheduled job of running the conky start script at midnight.
The part where it killed the running conkies ran, but it did not start the conkies, the same script works when started manually via Thunar Custom action.
My QSI:

Code: Select all

System:    Kernel: 5.10.0-24-amd64 [5.10.179-5] x86_64 bits: 64 compiler: gcc v: 10.2.1 
           parameters: BOOT_IMAGE=/boot/vmlinuz-5.10.0-24-amd64 root=UUID=<filter> ro quiet splash 
           Desktop: Xfce 4.18.1 tk: Gtk 3.24.24 info: xfce4-panel wm: xfwm 4.18.0 vt: 7 
           dm: LightDM 1.26.0 Distro: MX-21.3_x64 Wildflower April 9  2022 
           base: Debian GNU/Linux 11 (bullseye) 
Machine:   Type: Desktop Mobo: ASUSTeK model: M32CD v: Rev 1.xx serial: <filter> 
           UEFI: American Megatrends v: 0501 date: 08/28/2015 
CPU:       Info: Quad Core model: Intel Core i5-6400 bits: 64 type: MCP arch: Skylake-S family: 6 
           model-id: 5E (94) stepping: 3 microcode: F0 cache: L2: 6 MiB 
           flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx bogomips: 21599 
           Speed: 900 MHz min/max: 800/3300 MHz Core speeds (MHz): 1: 900 2: 900 3: 900 4: 900 
           Vulnerabilities: Type: gather_data_sampling status: Not affected 
           Type: itlb_multihit status: KVM: VMX disabled 
           Type: l1tf mitigation: PTE Inversion; VMX: conditional cache flushes, SMT disabled 
           Type: mds mitigation: Clear CPU buffers; SMT disabled 
           Type: meltdown mitigation: PTI 
           Type: mmio_stale_data mitigation: Clear CPU buffers; SMT disabled 
           Type: retbleed mitigation: IBRS 
           Type: spec_rstack_overflow status: Not affected 
           Type: spec_store_bypass 
           mitigation: Speculative Store Bypass disabled via prctl and seccomp 
           Type: spectre_v1 mitigation: usercopy/swapgs barriers and __user pointer sanitization 
           Type: spectre_v2 mitigation: IBRS, IBPB: conditional, STIBP: disabled, RSB filling, 
           PBRSB-eIBRS: Not affected 
           Type: srbds mitigation: Microcode 
           Type: tsx_async_abort status: Not affected 
Graphics:  Device-1: NVIDIA GM107 [GeForce GTX 750 Ti] vendor: eVga.com. driver: nvidia 
           v: 470.182.03 bus-ID: 01:00.0 chip-ID: 10de:1380 class-ID: 0300 
           Display: x11 server: X.Org 1.20.11 compositor: xfwm4 v: 4.18.0 driver: loaded: nvidia 
           display-ID: :0.0 screens: 1 
           Screen-1: 0 s-res: 1920x1200 s-dpi: 96 s-size: 508x318mm (20.0x12.5") 
           s-diag: 599mm (23.6") 
           Monitor-1: DVI-I-1 res: 1920x1200 hz: 60 dpi: 94 size: 519x324mm (20.4x12.8") 
           diag: 612mm (24.1") 
           OpenGL: renderer: NVIDIA GeForce GTX 750 Ti/PCIe/SSE2 v: 4.6.0 NVIDIA 470.182.03 
           direct render: Yes 
Audio:     Device-1: Intel 100 Series/C230 Series Family HD Audio vendor: ASUSTeK 
           driver: snd_hda_intel v: kernel bus-ID: 00:1f.3 chip-ID: 8086:a170 class-ID: 0403 
           Device-2: NVIDIA GM107 High Definition Audio [GeForce 940MX] vendor: eVga.com. 
           driver: snd_hda_intel v: kernel bus-ID: 01:00.1 chip-ID: 10de:0fbc class-ID: 0403 
           Sound Server-1: ALSA v: k5.10.0-24-amd64 running: yes 
           Sound Server-2: PulseAudio v: 14.2 running: yes 
Network:   Device-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet vendor: ASUSTeK 
           driver: r8169 v: kernel port: d000 bus-ID: 03:00.0 chip-ID: 10ec:8168 class-ID: 0200 
           IF: eth0 state: up speed: 1000 Mbps duplex: full mac: <filter> 
Drives:    Local Storage: total: 1.82 TiB used: 20.35 GiB (1.1%) 
           SMART Message: Unable to run smartctl. Root privileges required. 
           ID-1: /dev/sda maj-min: 8:0 vendor: Seagate model: ST1000LM024 HN-M101MBB 
           size: 931.51 GiB block-size: physical: 4096 B logical: 512 B speed: 6.0 Gb/s type: HDD 
           rpm: 5400 serial: <filter> rev: 0001 temp: 29.0 C scheme: GPT 
           ID-2: /dev/sdb maj-min: 8:16 vendor: Crucial model: CT1000MX500SSD1 size: 931.51 GiB 
           block-size: physical: 4096 B logical: 512 B speed: 6.0 Gb/s type: SSD serial: <filter> 
           rev: 045 temp: 26.0 C scheme: GPT 
Partition: ID-1: / raw-size: 30 GiB size: 29.36 GiB (97.87%) used: 8.01 GiB (27.3%) fs: ext4 
           dev: /dev/sdb2 maj-min: 8:18 
           ID-2: /boot/efi raw-size: 400 MiB size: 399.2 MiB (99.80%) used: 296 KiB (0.1%) 
           fs: vfat dev: /dev/sdb1 maj-min: 8:17 
           ID-3: /home raw-size: 901.12 GiB size: 885.91 GiB (98.31%) used: 12.34 GiB (1.4%) 
           fs: ext4 dev: /dev/sdb3 maj-min: 8:19 
Swap:      Alert: No swap data was found. 
Sensors:   System Temperatures: cpu: 4.5 C mobo: 27.8 C gpu: nvidia temp: 35 C 
           Fan Speeds (RPM): cpu: 872 fan-1: 989 fan-3: 0 fan-4: 0 fan-5: 0 fan-6: 0 gpu: nvidia 
           fan: 40% 
Repos:     Packages: note: see --pkg apt: 1995 lib: 1033 flatpak: 0 
           No active apt repos in: /etc/apt/sources.list 
           Active apt repos in: /etc/apt/sources.list.d/debian-stable-updates.list 
           1: deb http://deb.debian.org/debian/ bullseye-updates main contrib non-free
           Active apt repos in: /etc/apt/sources.list.d/debian.list 
           1: deb http://deb.debian.org/debian/ bullseye main contrib non-free
           2: deb http://security.debian.org/debian-security/ bullseye-security non-free contrib main
           3: deb http://deb.debian.org/debian/ bullseye-backports main contrib non-free
           Active apt repos in: /etc/apt/sources.list.d/home:hawkeye116477:waterfox.list 
           1: deb http://download.opensuse.org/repositories/home:/hawkeye116477:/waterfox/Debian_11/ /
           Active apt repos in: /etc/apt/sources.list.d/mx.list 
           1: deb http://mxrepo.com/mx/repo/ bullseye main non-free
           Active apt repos in: /etc/apt/sources.list.d/nala-sources.list 
           1: deb http://mirror.i3d.net/debian/ bullseye main contrib non-free
           2: deb http://mirror.cogentco.com/debian/ bullseye main contrib non-free
           3: deb http://la.mirrors.clouvider.net/debian/ bullseye main contrib non-free
           No active apt repos in: /etc/apt/sources.list.d/xanmod-kernel.list 
Info:      Processes: 230 Uptime: 29d 8h 20m wakeups: 1 Memory: 15.55 GiB used: 5.24 GiB (33.7%) 
           Init: SysVinit v: 2.96 runlevel: 5 default: 5 tool: systemctl Compilers: gcc: 10.2.1 
           alt: 10 Client: shell wrapper v: 5.1.4-release inxi: 3.3.06 
Boot Mode: UEFI

User avatar
timkb4cq
Developer
Posts: 3620
Joined: Wed Jul 12, 2006 4:05 pm

Re: Job Scheduler problem

#2 Post by timkb4cq »

It probably has to do with the environment being different when running in cron as when running from Thunar - but without seeing the script we can't really tell you.
HP Pavillion TP01, AMD Ryzen 3 5300G (quad core), Crucial 500GB SSD, Toshiba 6TB 7200rpm
Dell Inspiron 15, AMD Ryzen 7 2700u (quad core). Sabrent 500GB nvme, Seagate 1TB

User avatar
jeffreyC
Posts: 537
Joined: Mon May 27, 2019 10:39 am

Re: Job Scheduler problem

#3 Post by jeffreyC »

conky-startup.sh

Code: Select all

#!/bin/sh

sleep 6s
killall -u $(id -nu) conky 2>/dev/null
cd "$HOME/.conky"
conky -q -c "$HOME/.conky/BL-Cal-mod3.conkyrc" &
cd "$HOME/.conky/MX-MyConky"
conky -q -c "$HOME/.conky/MX-MyConky/MySysInfoConky" &
exit 0
located in my .conky folder.

User avatar
timkb4cq
Developer
Posts: 3620
Joined: Wed Jul 12, 2006 4:05 pm

Re: Job Scheduler problem

#4 Post by timkb4cq »

I'm assuming you used the Job Scheduler applet to set this up. Check if the job is set to run as root or your username.
If run as root $HOME = /root (and id -nu won't be what you expect either) and the job will fail.
HP Pavillion TP01, AMD Ryzen 3 5300G (quad core), Crucial 500GB SSD, Toshiba 6TB 7200rpm
Dell Inspiron 15, AMD Ryzen 7 2700u (quad core). Sabrent 500GB nvme, Seagate 1TB

User avatar
jeffreyC
Posts: 537
Joined: Mon May 27, 2019 10:39 am

Re: Job Scheduler problem

#5 Post by jeffreyC »

I set the job to run as my username using the Job Scheduler applet.
It ran the killall conky part and quit.

User avatar
dolphin_oracle
Developer
Posts: 22654
Joined: Sun Dec 16, 2007 12:17 pm

Re: Job Scheduler problem

#6 Post by dolphin_oracle »

cron executes scripts in the background inside of a limited environment.

I believe you'll need to give some environment variables, like "DISPLAY" at minimum.
http://www.youtube.com/runwiththedolphin
lenovo ThinkPad X1 Extreme Gen 4 - MX-23
FYI: mx "test" repo is not the same thing as debian testing repo.
Live system help document: https://mxlinux.org/wiki/help-antix-live-usb-system/

User avatar
DukeComposed
Posts: 1499
Joined: Thu Mar 16, 2023 1:57 pm

Re: Job Scheduler problem

#7 Post by DukeComposed »

dolphin_oracle wrote: Sat Sep 16, 2023 11:25 pm cron executes scripts in the background inside of a limited environment.

I believe you'll need to give some environment variables, like "DISPLAY" at minimum.
I was logging in to say exactly this. I find that running "env DISPLAY=:0.0 ~/.conky/conky_startup.sh" or however I instantiate it always seems to work when I'm starting conky from, say, inside of a tmux terminal session that normally wouldn't start it correctly.

I'll also add that my crontabs usually benefit from adding a PATH variable, and a MAILTO variable if I want to collect error messages.

Post Reply

Return to “Bugs and Non-Package Requests Forum”