You are not logged in.
Hello,
I do not understand what wiki page at arch that can help me to understand how I can start a daemon with certain configuration options. I know I can start with
# systemctl enable unit
, but for example, if I whanted to start "xboxdrv" with the option [--mimic-xpad-wireless --silent], or any other custom options I might need. I presume it can be done simple by dropping a .conf file somewhere, but I do not follow what wiki page that adress this - if it at all is possible?
Regards
Martin
It is advised to follow the How to post guide when posting on the Arch forum. If one consciously jumps over these elementary steps like reading the wiki and providing necessary information about the problem, one can be regarded as a Help Vampire.
Offline
Either add it to your ~/.xinitrc
https://wiki.archlinux.org/index.php/Xinitrc
Or use a display manager and this method to start the application by itself:
https://wiki.archlinux.org/index.php/Di … ow_manager
Or use ~/.xprofile to autostart it with a display manager:
https://wiki.archlinux.org/index.php/Xprofile
Offline
I second all of the above - but if you really want to use a systemd service, just copy the service file into /etc/systemd/system, modify the Exec line to add the flags you want, then enable your own editted service file.
"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" - Richard Stallman
Offline
Hello,
Suggested .xinitrc solution
Do you meen that in my .xinitrc file I should add (for xboxdrv):
exec xboxdrv --mimic-xpad-wireless --silent
Suggested systemd solution
Do you meen that after I activaded the xboxdrv at boot with "systemctl" I edit the "xboxdrv.service" file that is created and change this line:
ExecStart = /usr/bin/xboxdrv -D -c /etc/default/xboxdrv --detach-kernel-driver
to this
ExecStart = /usr/bin/xboxdrv -D -c /etc/default/xboxdrv --mimic-xpad-wireless --silent
Is there not a general .conf file location that you can add additional configuration files for systemd to be read when a deamon is activated?
Advantage over systemd
Both of you seemed to prefer not to use the systemd solution, what is the advantages over systemd with the other suggested solutions?
Regards
Martin
It is advised to follow the How to post guide when posting on the Arch forum. If one consciously jumps over these elementary steps like reading the wiki and providing necessary information about the problem, one can be regarded as a Help Vampire.
Offline
Suggested .xinitrc solution
Do you meen that in my .xinitrc file I should add (for xboxdrv):exec xboxdrv --mimic-xpad-wireless --silent
Please read the pages I have linked (all of them).
Re: systemd
I didn't suggest it 'cos I didn't know how to do that
You should read the relevant ArchWiki pages (and the upstream documentation) and decide which better suits your needs.
Offline
That line in the xinitrc cannot have the "exec", otherwise your winow manager will not run. According to the wiki, xboxdrv may need to be run as root, so putting it in xinitrc would not work (unless you used sudo and configured sudoers to run it without a password - not recommended).
The exec start line looks right, but no you should not edit the file that is created when you enable the service: no file is created, a symlink is created to a service file in /usr/lib/systemd/...
You should not edit those system-wide service files. Any edits you make will be overwritten at every update. This is why I gave the instructions I did. To add one preliminary step: do not enable (or disable) the current xboxdrv service. Then as suggested in my previous post copy the service file to /etc/systemd/system (or anywhere else really, your ~ could work), then edit that copy, then enable that modified copy.
Please see the wiki on using systemd. I am referring to the "replacement unit files" approach - but it seems the drop-in snipet approach would be even better.
"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" - Richard Stallman
Offline
Please see the wiki on using systemd. I am referring to the "replacement unit files" approach - but it seems the drop-in snipet approach would be even better.
Thank you, looks like the drop in option is the one i am looking for.
Also, thank you "Head_on_a_Stick" for suggested sollutions.
Sometimes as a new user it can be hard to grasp what part of the wiki that is refering to what you whant to do. Even if it is right in front of you
Regards
Martin
Last edited by onslow77 (2015-02-01 16:12:03)
It is advised to follow the How to post guide when posting on the Arch forum. If one consciously jumps over these elementary steps like reading the wiki and providing necessary information about the problem, one can be regarded as a Help Vampire.
Offline
Hello,
I followed the drop in option now in https://wiki.archlinux.org/index.php/Sy … n_snippets
I tried to copy the whole xboxdrv.service and replace the ExecStart, and also only with ExecStart, like this:
[Service]
ExecStart=
ExecStart= ExecStart = /usr/bin/xboxdrv -D -c /etc/default/xboxdrv --mimic-xpad-wireless --silent
The drop in examples above is in: /etc/systemd/system/xboxdrv.service.d/override.conf
Reatarting
I then made sure the new .conf file was loaded by:
# systemctl daemon-reload
# systemctl restart xboxdrv
# system status xboxdrv
Result
In both cases, the service fails to restart and I recive this error
xboxdrv.service has more than one ExecStart= setting, which is only allowed for Type=oneshot services. Refusing.
Anyone know how I can start "xboxdrv" with my custom options "--mimic-xpad-wireless --silent" using this drop in function for systemd?
Regards
Martin
Last edited by onslow77 (2015-02-01 18:27:31)
It is advised to follow the How to post guide when posting on the Arch forum. If one consciously jumps over these elementary steps like reading the wiki and providing necessary information about the problem, one can be regarded as a Help Vampire.
Offline
There is a typo on the second line where you repeat "ExecStart=" twice. If that is in the file too, that is likely the problem.
"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" - Richard Stallman
Offline
There is a typo on the second line where you repeat "ExecStart=" twice. If that is in the file too, that is likely the problem.
Hello,
It is not a typo, from the systemd wiki it says "Note how ExecStart must be cleared before being re-assigned " They show an example with one empty ExacStart (to clear it) and then a new ExecStart where you assign the new command.
I give it a try thou with just one to see if that works.
Regards
Martin
It is advised to follow the How to post guide when posting on the Arch forum. If one consciously jumps over these elementary steps like reading the wiki and providing necessary information about the problem, one can be regarded as a Help Vampire.
Offline
ooh, now I see, I wrote:
ExecStart= ExecStart = /usr/bin/xboxdrv -D -c /etc/default/xboxdrv --mimic-xpad-wireless --silent
Yes, maybe I did put that in, I try again.
Regards
Martin
It is advised to follow the How to post guide when posting on the Arch forum. If one consciously jumps over these elementary steps like reading the wiki and providing necessary information about the problem, one can be regarded as a Help Vampire.
Offline
Hello,
Yes, I did put in ExecStart twice just as in my example. So when I did:
[Service]
ExecStart=
ExecStart = /usr/bin/xboxdrv -D -c /etc/default/xboxdrv --mimic-xpad-wireless --silent
It reloaded correctly.
Problem still persist thou
If I manully start xboxdrv with:
# xboxdrv --mimic-xpad-wireless --silent
I get the game "XCOM Enemy within" to recognize my controller, which it does not if I have "xboxdrv" started with only:
# systemctl enable xboxdrv
That is why I try to implement the manual option "--mimic-xpad..." with the systemd drop in function. Anyone know what I have missed to make this work?
Regards
Martin
Last edited by onslow77 (2015-02-01 19:36:31)
It is advised to follow the How to post guide when posting on the Arch forum. If one consciously jumps over these elementary steps like reading the wiki and providing necessary information about the problem, one can be regarded as a Help Vampire.
Offline
I can't find anything in the documentation explicitly specifying it, but I've never seen unit files with spaces around the "=" as you have used. Try removing them.
"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" - Richard Stallman
Offline
I can't find anything in the documentation explicitly specifying it, but I've never seen unit files with spaces around the "=" as you have used. Try removing them.
Hello,
This unfortantly made no difference, and it still does not work. When running
systemctl status xboxdrv
it clearly states (see below) that I am using the override.conf file, and no errors are given, so why it does not work, I do not know.
● xboxdrv.service - Gamepad management daemon
Loaded: loaded (/usr/lib/systemd/system/xboxdrv.service; enabled; vendor preset: disabled)
Drop-In: /etc/systemd/system/xboxdrv.service.d
└─override.conf
Active: active (running) since Sun 2015-02-01 21:09:22 CET; 8s ago
Main PID: 2432 (xboxdrv)
CGroup: /system.slice/xboxdrv.service
└─2432 /usr/bin/xboxdrv -D -c /etc/default/xboxdrv --mimic-xpad-wireless --silent
Regards
Martin
Last edited by onslow77 (2015-02-02 11:15:49)
It is advised to follow the How to post guide when posting on the Arch forum. If one consciously jumps over these elementary steps like reading the wiki and providing necessary information about the problem, one can be regarded as a Help Vampire.
Offline