This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Kmix service missing in cron

Tags: None
(comma "," separated)
User avatar
blue_bullet
Registered Member
Posts
87
Karma
0
OS

Kmix service missing in cron

Thu Feb 06, 2014 7:30 pm
I originally posted this in the KDE section of the Linux Mint Forums on January 17, 2014 and have so far gotten no response. I thought I would post it here
in hopes of getting some help:

My cron environment has changed in Linux Mint 16 KDE (Petra 64 bit) from prior releases of Linux Mint (11-15). I need help restoring it to pre-Petra release environment.
In earlier releases of Linux Mint KDE (11-15) my cron job worked. Now in 16 (Petra) it no longer works because kmix service is not available. Here is the command in my /etc/crontab:
Code: Select all
43 14 * * * rob export DISPLAY=:0 && rexx /home/rob/Dropbox/shared_rcss_complex/toggle_mute.rexx on . off


The purpose of the routine is to use qdbus to mute or unmute sound volume at different times of day when executed from cron.
My routine works from Konsole and at but not in cron. Can someone tell me how to get the kmix service available in cron again?

Here's the output from cron in Linux Mint 16 KDE where I issue 3 separate commands (failed routine):
(1) qdbus
Code: Select all
:1.15
:1.16
 org.kde.klauncher
:1.18
:1.19
:1.5
 org.kde.kded
:1.8
 org.kde.knotify
org.freedesktop.DBus


(2) qdbus org.kde.kmix
Code: Select all
Service 'org.kde.kmix' does not exist.



(3) qdbus org.kde.kmix /kmix/KMixWindow/actions/mute org.qtproject.Qt.QAction.trigger
Code: Select all
Service 'org.kde.kmix' does not exist.



Here's the output from cron in Linux Mint 14 KDE where I issue the same 3 separate commands (routine works):

(1) qdbus
Code: Select all
:1.1
 org.kde.klauncher
:1.11
 org.kde.kwin
 org.kde.kwin-2261
 org.kde.kwin.Scripting
:1.1181
 org.kde.kscreenlocker-25052
 org.kde.screenlocker
:1.1183
 org.kde.plasma-overlay
:1.1185
 org.kde.kscience.kss-25054
:1.12
 org.kde.knotify
:1.1230
 org.kde.StatusNotifierItem-2678-753
:1.1231
:1.14
 org.kde.DeviceNotifications
 org.kde.StatusNotifierHost-2429
 org.kde.plasma-desktop
:1.16
 org.freedesktop.ScreenSaver
 org.kde.krunner
 org.kde.screensaver
:1.177
 org.kde.kdesudo-29270
:1.18
:1.19
 org.freedesktop.Akonadi.Control
 org.freedesktop.Akonadi.Control.lock
:1.2
 org.freedesktop.PowerManagement
 org.freedesktop.PowerManagement.Inhibit
 org.kde.Solid.PowerManagement
 org.kde.Solid.PowerManagement.PolicyAgent
 org.kde.StatusNotifierWatcher
 org.kde.Wacom
 org.kde.kded
 org.kde.keyboard
 org.kde.networkmanagement
 org.kubuntu.NotificationHelper
 org.kubuntu.restrictedInstall
:1.20
 org.freedesktop.Akonadi
:1.21
 org.freedesktop.Akonadi.Janitor
:1.22
:1.23
 org.freedesktop.Akonadi.Agent.akonadi_akonotes_resource_0
 org.freedesktop.Akonadi.Resource.akonadi_akonotes_resource_0
:1.24
 org.freedesktop.Akonadi.Agent.akonadi_contacts_resource_0
 org.freedesktop.Akonadi.Resource.akonadi_contacts_resource_0
:1.25
 org.freedesktop.Akonadi.Agent.akonadi_ical_resource_0
 org.freedesktop.Akonadi.Resource.akonadi_ical_resource_0
:1.26
 org.freedesktop.Akonadi.Agent.akonadi_maildir_resource_0
 org.freedesktop.Akonadi.Resource.akonadi_maildir_resource_0
:1.27
 org.freedesktop.Akonadi.Agent.akonadi_nepomuk_feeder
 org.kde.akonadi_nepomuk_feeder-2489
:1.28
 org.freedesktop.Akonadi.Agent.akonadi_maildispatcher_agent
 org.freedesktop.Akonadi.MailDispatcherAgent
 org.kde.akonadi_maildispatcher_agent-2487
:1.290
:1.306
:1.32
 org.freedesktop.Akonadi.Agent.akonadi_mailfilter_agent
 org.freedesktop.Akonadi.MailFilterAgent
 org.kde.akonadi_mailfilter_agent-2488
:1.33
 org.freedesktop.Akonadi.Agent.akonadi_archivemail_agent
 org.freedesktop.Akonadi.ArchiveMailAgent
 org.kde.akonadi_archivemail_agent-2483
:1.34
:1.35
 org.PulseAudio1
 org.freedesktop.ReserveDevice1.Audio0
 org.pulseaudio.Server
:1.38
 org.gtk.vfs.Daemon
:1.39
 com.googlecode.autokey-2532
:1.42
 org.autokey.Service
:1.43
 de.lunaryorn.synaptiks
:1.45
 org.kde.StatusNotifierItem-2673-1
:1.46
 org.kde.Polkit1AuthAgent
:1.48
 org.kde.kmix
:1.5
 org.kde.kglobalaccel
:1.50
 org.kde.klipper
:1.52
 org.kde.printer-applet-2675
:1.53
 org.kde.StatusNotifierItem-2682-1
:1.56
 org.kde.StatusNotifierItem-2675-1
:1.57
:1.58
:1.77
:1.78
:1.79
 org.a11y.Bus
:1.8
 org.kde.ksmserver
 org.kde.ksmserver-2259
:1.80
:1.81
 org.gnome.GConf
:1.9
 org.kde.ActivityManager
 org.kde.kactivitymanagerd
org.freedesktop.DBus


(2) qdbus org.kde.kmix
Code: Select all
/
/MainApplication
/Mixers
/Mixers/0
/Mixers/0/alsa_output_pci_0000_00_1b_0_analog_stereo
/Mixers/0/alsa_output_pci_0000_01_00_1_hdmi_stereo
/Mixers/1
/Mixers/1/alsa_input_pci_0000_00_1b_0_analog_stereo
/Mixers/2
/Mixers/2/restore_sink_input_by_media_role_event
/Mixers/2/stream_101
/Mixers/2/stream_136
/Mixers/2/stream_137
/Mixers/2/stream_148
/Mixers/2/stream_17
/Mixers/2/stream_172
/Mixers/2/stream_18
/Mixers/2/stream_183
/Mixers/2/stream_202
/Mixers/2/stream_203
/Mixers/2/stream_204
/Mixers/2/stream_205
/Mixers/2/stream_206
/Mixers/2/stream_207
/Mixers/2/stream_208
/Mixers/2/stream_209
/Mixers/2/stream_210
.
.
.
/Mixers/2/stream_693
/Mixers/2/stream_694
/Mixers/2/stream_696
/Mixers/2/stream_697
/Mixers/2/stream_85
/Mixers/3
/kmix
/kmix/KMixWindow
/kmix/KMixWindow/actions
/kmix/KMixWindow/actions/file_quit
/kmix/KMixWindow/actions/options_show_menubar
/kmix/KMixWindow/actions/options_configure
/kmix/KMixWindow/actions/options_configure_keybinding
/kmix/KMixWindow/actions/launch_kdesoundsetup
/kmix/KMixWindow/actions/hwinfo
/kmix/KMixWindow/actions/hide_kmixwindow
/kmix/KMixWindow/actions/toggle_channels_currentview
/kmix/KMixWindow/actions/select_master
/kmix/KMixWindow/actions/save_1
/kmix/KMixWindow/actions/save_2
/kmix/KMixWindow/actions/save_3
/kmix/KMixWindow/actions/save_4
/kmix/KMixWindow/actions/load_1
/kmix/KMixWindow/actions/load_2
/kmix/KMixWindow/actions/load_3
/kmix/KMixWindow/actions/load_4
/kmix/KMixWindow/actions/increase_volume
/kmix/KMixWindow/actions/decrease_volume
/kmix/KMixWindow/actions/mute



(3) qdbus org.kde.kmix /kmix/KMixWindow/actions/mute org.qtproject.Qt.QAction.trigger
Volume muted in toggle_mute.



I do not see where the services are initialized in the crond script. I have posted the same request for help on the kde forum as well since I do not know if this is a KDE, Linux Mint KDE, or a QT issue. I have had to change a number of things to get cron and IPCs to work on this version of LM. :(


Migrated from Linux Mint 17.3/18.3 KDE to KDE neon User Edition.
User avatar
google01103
Manager
Posts
6668
Karma
25
first I am clueless about any of this but that won't stop me from making a suggestion - try using kalarm instead of cron


OpenSuse Leap 42.1 x64, Plasma 5.x

User avatar
blue_bullet
Registered Member
Posts
87
Karma
0
OS

Re: Kmix service missing in cron

Thu Feb 06, 2014 11:07 pm
google01103 wrote:first I am clueless about any of this but that won't stop me from making a suggestion - try using kalarm instead of cron

Thank you for the suggestion. Kalarm does work. I had to start akonadi before kalarm would work. I get no mail output like I do with cron, and I had to invoke the rexx routine with a script (toggle_mute.sh) in kalarm. I will experiment more with kalarm and mark your suggestion as the solution once I get it sorted out. My guess is that kalarm is working in an environment similar to at rather than the cron environment. Thanks again for the suggestion. I will follow up.


Migrated from Linux Mint 17.3/18.3 KDE to KDE neon User Edition.
User avatar
sandsmark
KDE Developer
Posts
64
Karma
0
OS

Re: Kmix service missing in cron

Fri Feb 07, 2014 12:11 am
blue_bullet wrote:I get no mail output like I do with cron

did you set up your mail client in the settings?

blue_bullet wrote:and I had to invoke the rexx routine with a script (toggle_mute.sh) in kalarm.

I'm not familiar with rexx, but doesn't it have a hashbang-compatible interpreter? if so, you should be able to just mark it as executable.

and as for the reason it broke, I guess the Linux Mint people have changed something related to which dbus session the cron daemon is able to connect to.


User avatar
blue_bullet
Registered Member
Posts
87
Karma
0
OS

Re: Kmix service missing in cron

Fri Feb 07, 2014 6:24 pm
sandsmark wrote:
blue_bullet wrote:I get no mail output like I do with cron

did you set up your mail client in the settings?
Apparently I did not. I guess I have to change from Thunderbird to Kmail now that I have Akonadi running. I was unable to get the email alarm it to work with Tbird even though I have my default email client application defined as "thunderbird %u". I have smtp installed to work with cron. I think kalarm may want sendmail installed instead. I get an error in kalarm: "Failed to send email: No mail transport configured for email identity."

blue_bullet wrote:and I had to invoke the rexx routine with a script (toggle_mute.sh) in kalarm.

I'm not familiar with rexx, but doesn't it have a hashbang-compatible interpreter? if so, you should be able to just mark it as executable.
Rexx is a scripting language developed by IBM back in the 1980's. Regina Rexx is open source and works on all platforms. I use it instead of bash since I learned it years ago.
In Kalarm I am able to use the command:
rexx /home/rob/Dropbox/shared_rcss_complex/toggle_mute.rexx on . off

to mute volume at midnight and
rexx /home/rob/Dropbox/shared_rcss_complex/toggle_mute.rexx on . on

to unmute volume at 7am everyday. Works like a charm.

Here's what my kalarm window looks like:

Image


and as for the reason it broke, I guess the Linux Mint people have changed something related to which dbus session the cron daemon is able to connect to.

I think you are correct there. I had to make changes to qt4 and qt5 to get cron to see dbus. Something was dropped on the move from LM 15 to LM16.

Google01103 suggested using Kalarm. It is a workaround but a nice way to deal with muting/unmuting volumes. The problem remains with cron and its environment. I will try to get the problem communicated to the Linux Mint people. Thank you both for your help and suggestions.


Migrated from Linux Mint 17.3/18.3 KDE to KDE neon User Edition.
cesken
Registered Member
Posts
2
Karma
0

Re: Kmix service missing in cron

Fri Mar 07, 2014 7:57 am
While I have no direct solution here, I think that there should be some output somewhere. Either a mail (look in ALL mailboxes, also from root, specific "cron" users and so on) or in a logfile. There are various possible issue I can think of:
- Permission problem, like not allowed to connect to the desktop session. But often it is enough to set DISPLAY like you do, or described in my Blog: http://kmix5.wordpress.com/2013/12/28/k ... e-control/
- KMix not (yet) running. But this will only be a problem when logging in, not when you let your PC running.
- Wrong desktop session selected

From your post it is obvious that a dbus session is there, but no "real" apps, not even KWin or Plasma is there. Could it be that Mint 16 has a secondary X11 session running somewhere? IS DISPLAY really correctly set, or are you suddenly on DISPLAY=:1 or DISPLAY=:47. Would you check that?


Bookmarks



Who is online

Registered users: bartoloni, Bing [Bot], Evergrowing, Google [Bot]