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

Rare self-starter that doesn't work

Tags: None
(comma "," separated)
Toberius
Registered Member
Posts
11
Karma
0
OS

Rare self-starter that doesn't work

Sat May 16, 2020 5:32 pm
Hi there,
I just to add a command to autostart from autostart screen config but its doesn't start.
I wish to start mpd locate in /usr/bin/mpd and nothing happens after that either, now if I create a script nor start, but if I add a sleep 10 for instance into that script before next line, well, this autostart starts fine.

I just wondering if it is an issue of mpd.

Muy best.
Toberius
Registered Member
Posts
11
Karma
0
OS
No one have this issue?
koffeinfriedhof
Registered Member
Posts
608
Karma
4
OS
No one can help you if you do not provide any relevant information.
Whats your OS?
What shell are you using?
What error messages are in dmesg/syslog/journalctl conerning your problem?
What have you tried and what were the exact results?
Show your script in code-tags.
…and so on
Toberius
Registered Member
Posts
11
Karma
0
OS
Sorry.
I run Gentoo openrc and bash.
No message from dmesg.
I wish to autostart a command: mpd
No script now, just only a command.
koffeinfriedhof
Registered Member
Posts
608
Karma
4
OS
Okay, so there is no systemd-unit to handle with :)

Do you have mpd installed as a global package or only for one user? And how did you add it to the Plasma-Autostart? As Desktopfile or as Scriptfile?

As an example, it is enough for plasma to enter the command line command in the properties tab "application" and leave the rest blank (I'm using this for a systemd-user-command like this)

For mpd, it depends on how the mpd-server is set up. Globally it should be startet by a system service, if you want to run it as a user, place your configuration in ~/.mpdconf and create the folders ~/mpd/ and ~/.mpd/playlist/. Then disable it globally with
Code: Select all
update-rc.d mpd disable
(or what fits to your installation, I do not use gentoo or openrc).
Toberius
Registered Member
Posts
11
Karma
0
OS
Thanks for response.
I have already install mpd like global package, and I wish to run with my regular user.
I saw what KDE use ~/.config/autostart for autostart desktopfiles and scripts commands once session start.
Well, I put my "script", bah, is a simple file bash with 1 or 3 lines, /usr/bin/mpd ~/.mpd/mpd.conf
But I don't know what is happens, the script also have x permission file.
Besides, I made the same script with only 1 command, mpd, and nothing happens.

edit: I haven't run mpd like a service (rc-service start mpd)
koffeinfriedhof
Registered Member
Posts
608
Karma
4
OS
You could try another approach to check if autostart itself works on your system. Testing Desktopfile as ~/.config/autostart/testfile.desktop:
Code: Select all
[Desktop Entry]
Comment=
Exec=/usr/bin/touch /tmp/testfile_touched
GenericName=
Icon=system-run
MimeType=
Name=
Path=
StartupNotify=true
Terminal=false
TerminalOptions=
Type=Application
X-DBUS-ServiceName=
X-DBUS-StartupType=
X-KDE-SubstituteUID=false
X-KDE-Username=


Autostarting a script basically works with symlinks to ~/.config/autostart-scripts/, but you can place a script there too:
Code: Select all
#!/bin/bash
/usr/bin/touch /tmp/testfile_script_touched


Then you can check if those tmp-files are properly created. If this works, you should concentrate on mpd-configuration on startup. Is the network set up? Is the mpd-server running on/while executing the script? Are all needed partitions mounted properly? Do you have file access while trying to start?

You can also check http://server-ip:8000 with curl or wget to determine if you have access to your mpd-instance.
Toberius
Registered Member
Posts
11
Karma
0
OS
Ok koffeinfriedhof
I did like you said me and testfile.desktop works, but doesn't work using /usr/bin/mpd ~/.mpd/mpd.conf and no logs also.
Looks like that process autostart can't reach.
koffeinfriedhof
Registered Member
Posts
608
Karma
4
OS
There is a description on archlinux wiki: MPD - per user configuration.

If the server and client are running, you can place needed steps into your autostart-script.
Toberius
Registered Member
Posts
11
Karma
0
OS
Thanks for you help koffeinfriedhof, I was unable to achieve mpd works in autostart users task.
Once I start user session from terminal I run fine mpd command.


Bookmarks



Who is online

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