View previous topic :: View next topic |
Author |
Message |
CaptainBlood Advocate
Joined: 24 Jan 2010 Posts: 3519
|
Posted: Mon Sep 04, 2017 10:59 pm Post subject: openrc/VHBA udev rules & cdemu-daemon&Co... [ebuild] |
|
|
Hi,
Something seemed wrong when gcdemu was 1st installed, because to have it working I had to push a rule in /etc/udev/rules.d. i.e. to allow cdemu group against /dev/vhba_ctl.
After stable upgrade, it seems like this rule is gone and all I can see is Code: | /lib/udev/rules.d/69-vhba.rules:KERNEL=="vhba_ctl", SUBSYSTEM=="misc", TAG+="uaccess" |
New stable vhba doesn't show Code: | Log: postinst
Don't forget to add your user to the cdemu group if you want to
be able to use virtual cdemu devices. | anymore. So should cdemu group be deleted???
But the main question is: Since it doesn't work out of the upgrade box what is the correct way to have it working?
Restoring my udev rule for vhba? (This is what I did for a fix, but I'd rather like things to be as right as possible.)
How is it supposted to work from Code: | KERNEL=="vhba_ctl", SUBSYSTEM=="misc", TAG+="uaccess" | to user:users profile, or even user:cdemu?
Maybe out of scope: eudev here, not systemd.
Thanks 4 ur attention, interest & support.
Last edited by CaptainBlood on Wed Sep 08, 2021 5:39 pm; edited 4 times in total |
|
Back to top |
|
|
VoidMage Watchman
Joined: 14 Oct 2006 Posts: 6196
|
Posted: Wed Sep 27, 2017 12:44 pm Post subject: |
|
|
Thanks for the heads up.
Personally, I'm not sure how tightly 'uaccess' tag is bound with systemd, given that technically it's an udev builtin.
For quite awhile instead of that main repo group rule, I've been using following (obviously combined with udev-acl (from consolekit))
Code: |
KERNEL=="vhba_ctl", MODE="0660", OWNER="root", GROUP="cdemu", TAG+="udev-acl"
KERNEL=="vhba_ctl", TEST=="/var/run/ConsoleKit/database", RUN+="udev-acl --action=\$env{ACTION} --device=\$env{DEVNAME}"
|
There's a bit of redundancy there, but it worked reasonably well. No idea, if uaccess can be used for something similar outside systemd.
PS: to clarify, while I was leaving the GROUP bit, I never bothered to add my user to cdemu group - with these rules, things worked as with any normal removable drive. |
|
Back to top |
|
|
cameta Veteran
Joined: 04 Aug 2004 Posts: 1318
|
Posted: Sat Sep 30, 2017 7:52 am Post subject: |
|
|
With the new stable vhba I can't start the cdemu-daemon
Code: | uname -r
4.12.12-gentoo
|
Code: | cdemu-daemon
Starting CDEmu daemon with following parameters:
- num devices: 1
- control device: /dev/vhba_ctl
- audio driver: null
- bus type: session
cdemu0: Kernel I/O: failed to open control device /dev/vhba_ctl: Permission denied!With the
cdemu: Daemon: failed to start device #0!
cdemu: Daemon: failed to create device!
Daemon initialization and start failed!
|
Only the user root can read and write the /dev/vhba_ctl . _________________ Si algo falla LEE el jodido manual, Si sigue fallando LEE BIEN el jodido manual. |
|
Back to top |
|
|
CaptainBlood Advocate
Joined: 24 Jan 2010 Posts: 3519
|
Posted: Sat Sep 30, 2017 9:47 am Post subject: |
|
|
Here: Code: | cat /etc/udev/rules.d/60-vhba.rules
KERNEL=="vhba_ctl", MODE="0660", OWNER="root", GROUP="cdemu" |
Code: | grep cdemu /etc/group
cdemu:x:981:<USERNAME> | which may work without acl.
Thks 4 ur attention, interest & support. |
|
Back to top |
|
|
cameta Veteran
Joined: 04 Aug 2004 Posts: 1318
|
Posted: Sat Sep 30, 2017 12:37 pm Post subject: |
|
|
Thank You very much
Code: | grep cdemu /etc/group
cdemu:x:981:<USERNAME> |
I have done it this way
Code: | gpasswd -a username cdemu |
I think that It would be necessary to open a bug for the ebuild. _________________ Si algo falla LEE el jodido manual, Si sigue fallando LEE BIEN el jodido manual. |
|
Back to top |
|
|
Ambrevar n00b
Joined: 11 Jul 2017 Posts: 11
|
Posted: Sat Nov 25, 2017 3:37 pm Post subject: |
|
|
I ran into the same issue and the aforementioned fix works.
Has anyone reported the issue? |
|
Back to top |
|
|
cord Guru
Joined: 28 Apr 2007 Posts: 344
|
Posted: Sun Jul 01, 2018 2:19 pm Post subject: |
|
|
Code: | cat /etc/udev/rules.d/60-vhba.rules
KERNEL=="vhba_ctl", MODE="0660", OWNER="root", GROUP="cdemu" |
I don't have "cdemu" group in my system (seems to be it wasn't created at install). I that normal? |
|
Back to top |
|
|
CaptainBlood Advocate
Joined: 24 Jan 2010 Posts: 3519
|
Posted: Fri Oct 25, 2019 6:39 am Post subject: |
|
|
Same here after rebuild of the whole system.
I've set it to cdrom instead, which works. accordingly to Official site link
Thks 4 ur attention, interest & support.
Last edited by CaptainBlood on Sat Oct 26, 2019 1:48 am; edited 3 times in total |
|
Back to top |
|
|
CaptainBlood Advocate
Joined: 24 Jan 2010 Posts: 3519
|
Posted: Fri Oct 25, 2019 6:41 am Post subject: |
|
|
Doesn't seem to work with any of 3.7.x gentoo-sources here, which where all migrated from working 3.2.x by applyingThks 4 ur attention, interest & support.
Last edited by CaptainBlood on Sat Oct 26, 2019 1:53 am; edited 1 time in total |
|
Back to top |
|
|
CaptainBlood Advocate
Joined: 24 Jan 2010 Posts: 3519
|
Posted: Sat Oct 26, 2019 1:37 am Post subject: |
|
|
vhba-20190831 fixes 3.7.x kernel series issue, 20190827 doesn't.
Wouldn't be surprised 20190827 being useless.
Thks 4 ur attention, interest & support |
|
Back to top |
|
|
CaptainBlood Advocate
Joined: 24 Jan 2010 Posts: 3519
|
Posted: Wed Jun 02, 2021 5:35 pm Post subject: |
|
|
It's being working fine here along with openrc/elogind since,
as Code: | cat 69-vhba.rules
# do not edit this file, it will be overwritten on update
#
KERNEL=="vhba_ctl", MODE="0660", OWNER="root", GROUP="cdrom" |
Code: | grep cdrom /etc/group
cdrom:x:19:<USERNAME> | until today, where trying to mount iso image which triggers Code: | Daemon autostart failed. Error:
g-io-error-quark: 'Error while calling StartServiceByName for net.sf.cdemu.CDEmuDaemon : Time-out reached (24)' <Translated> |
Code: | echo 'KERNEL=="vhba_ctl", SUBSYSTEM=="misc", TAG+="udev-acl"' | sudo tee /etc/udev/rules.d/vhba-dkms.udev ; sudo udevadm control --reload-rules ; sudo udevadm trigger ; cdemu-daemon &
gcdemu | from Github works fine.
Accordingly I guess there is an integration issue I hav'ent figured out a fix for yet.
Moreover the above working command only loads GUI interface for cdemu.
An additional manual step is required to load an iso, whereas iso image were mountable from user file browser session.
Any idea is welcome.
Thks 4 ur attention, interest & support. _________________ USE="-*" in /etc/portage/make.conf here. |
|
Back to top |
|
|
Anon-E-moose Watchman
Joined: 23 May 2008 Posts: 6095 Location: Dallas area
|
Posted: Wed Jun 02, 2021 6:13 pm Post subject: |
|
|
If you want a rule to hang around, put it in /etc/udev/rules.d not /lib/udev/rules.d
Edit to add: https://bugs.launchpad.net/cdemu/+bug/1926303
Your problem is likely to be dbus related. _________________ PRIME x570-pro, 3700x, 6.1 zen kernel
gcc 13, profile 17.0 (custom bare multilib), openrc, wayland |
|
Back to top |
|
|
CaptainBlood Advocate
Joined: 24 Jan 2010 Posts: 3519
|
Posted: Wed Jun 02, 2021 6:56 pm Post subject: |
|
|
Anon-E-moose,
thks 4 the link.
I currently investigating accordingly.
udev rules have always been a brain killer here...
I've indeed forgot to provide file path:
Code: | cat /etc/udev/rules.d/69-vhba.rules
# do not edit this file, it will be overwritten on update
#
KERNEL=="vhba_ctl", MODE="0660", OWNER="root", GROUP="cdrom" |
As a workaround Code: | cat /etc/portage/package.mask/monolithic.conf
#>sys-fs/vhba-20200106-r1
>=app-cdr/cdemu-daemon-3.2.5
>=app-cdr/cdemu-3.2.5
>=app-cdr/gcdemu-3.2.5 | recovers feature here.
Issue could be somewhere in dbus related config or executable file in 3.2.5.
Another pain will be relocating 3.2.4 to local repo before deletion from the portage tree.
Thks 4 ur attention, interest & support. _________________ USE="-*" in /etc/portage/make.conf here. |
|
Back to top |
|
|
Anon-E-moose Watchman
Joined: 23 May 2008 Posts: 6095 Location: Dallas area
|
Posted: Wed Jun 02, 2021 7:11 pm Post subject: |
|
|
dbus is used to start the daemon.
a simple dbus-run-session -- cdemu would probably work (on the newer one)
OR
simply start the daemon yourself, ahead of using the gui. _________________ PRIME x570-pro, 3700x, 6.1 zen kernel
gcc 13, profile 17.0 (custom bare multilib), openrc, wayland |
|
Back to top |
|
|
CaptainBlood Advocate
Joined: 24 Jan 2010 Posts: 3519
|
Posted: Wed Jun 02, 2021 7:39 pm Post subject: |
|
|
Thks again,
will give it a assumption checking try.
Scarcely used background deamon launch be default is not wishable in the long run, though.
The main problem is likely that cdemu app stack seems designed for systemd, with udev rules designed accordingly.
IIRC when I tried to ask for help when not using systemd, my request was somehow rejected.
Cherry picking with google was my only salute for a fix then...
Thks 4 ur attention, interest & support. _________________ USE="-*" in /etc/portage/make.conf here. |
|
Back to top |
|
|
Anon-E-moose Watchman
Joined: 23 May 2008 Posts: 6095 Location: Dallas area
|
Posted: Wed Jun 02, 2021 7:48 pm Post subject: |
|
|
If running separately (because dbus not installed for example) then I'd wrap it in shell script, first start the daemon then the client side and pass all arguments sent to the script. _________________ PRIME x570-pro, 3700x, 6.1 zen kernel
gcc 13, profile 17.0 (custom bare multilib), openrc, wayland |
|
Back to top |
|
|
CaptainBlood Advocate
Joined: 24 Jan 2010 Posts: 3519
|
Posted: Sun Aug 08, 2021 5:32 pm Post subject: |
|
|
Anon-E-moose,
Thks 4 ur support, as it gave me courage enough to catch the source of the issue:
3.2.5 fails to install: Code: | ll /usr/libexec/cdemu-daemon-session.sh
-rwxr-xr-x 1 root root 521 janv. 6 2020 /usr/libexec/cdemu-daemon-session.sh | which 3.2.4 version contains Code: | cat /usr/libexec/cdemu-daemon-session.sh
#!/bin/sh
# Starts the CDEmu daemon instance on D-Bus *session* bus. Optional
# configuration (number of devices, audio driver, log file) are read
# from ~/.cdemu-daemon
# Default settings
NUM_DEVICES=1
AUDIO_DRIVER=default
LOG_FILE=~/.cdemu-daemon.log
# Read the settings
CONFIG_FILE=~/.cdemu-daemon
if [ -f ${CONFIG_FILE} ]; then
. ${CONFIG_FILE};
fi
# Start the daemon
exec cdemu-daemon --ctl-device=/dev/vhba_ctl --bus=session --num-devices=${NUM_DEVICES} --audio-driver=${AUDIO_DRIVER} --logfile=${LOG_FILE} | Guess it's time for setting a local ebuild release version.
That solves the underlying 3.2.4 issue <=python3_8
Thks 4 ur attention, interest & support _________________ USE="-*" in /etc/portage/make.conf here. |
|
Back to top |
|
|
Tratkazir_the_1st n00b
Joined: 18 Feb 2020 Posts: 16
|
Posted: Tue Aug 10, 2021 5:31 am Post subject: |
|
|
(Correct me pls if I'm writing to wrong topic)
Pls check UID\GID of file /dev/vhba_ctls. Mine were root:root. After changing them to root:cdrom & manual startup of cdemu daemon - everything works . (The very idea of UID\GID check I've got from secondary installed system, Devuan. Everything was working there right after package installation. Pls excuse my bad English .) |
|
Back to top |
|
|
CaptainBlood Advocate
Joined: 24 Jan 2010 Posts: 3519
|
Posted: Tue Aug 10, 2021 11:55 am Post subject: |
|
|
Tratkazir_the_1st,
You're welcome here.
My guess is you're using systemd, isn't it, as the file you mentionned doesn't exist here on openrc.
I've clarified this constraint in the OP title.
Anyhow, thks for posting, as you forced me to revaluate my original fix which didn't work after a reboot.
Indeed, additionally to restoring /usr/libexec/cdemu-daemon-session.sh from 3.2.4,one existing 3.2.5 file has to be edited from 3.2.5 version: Code: | cat /usr/share/dbus-1/services/net.sf.cdemu.CDEmuDaemon.service
DEmuDaemon.service
[D-BUS Service]
Name=net.sf.cdemu.CDEmuDaemon
SystemdService=cdemu-daemon.service
Exec=/bin/true | back to its 3.2.4 version: Code: | cat /usr/share/dbus-1/services/net.sf.cdemu.CDEmuDaemon.service
[D-BUS Service]
Name=net.sf.cdemu.CDEmuDaemon
Exec=/usr/libexec/cdemu-daemon-session.sh | I've tested after a cold reboot.
Working fine here.
The ebuild.log warns about the issue: Code: | As of 3.2.5, cdemu-daemon no longer supports autoloading
on non-systemd systems. OpenRC users have to start it manually.
We install /etc/modules-load.d/vhba.conf to load the module
automatically, and D-BUS autolaunch will start cdemu-daemon user
service. | Guess it's time to patch 3.2.5 ebuild with a openrc or a systemd USE flag.
Thks 4 ur attention, interest & support. _________________ USE="-*" in /etc/portage/make.conf here. |
|
Back to top |
|
|
Tratkazir_the_1st n00b
Joined: 18 Feb 2020 Posts: 16
|
Posted: Thu Aug 12, 2021 8:55 am Post subject: |
|
|
CaptainBlood wrote: | Tratkazir_the_1st,
My guess is you're using systemd, isn't it, as the file you mentionned doesn't exist here on openrc.
|
Wrong assumtion because I hate systemd & that was the cause of my switch from Debian to Gentoo .
The mentioned file exists when module vhba.ko is loaded someway (manually or by .conf in /etc/modprobe.d). At last one guy from other forum (russian, where I read\write alot) advised me to check groups. My user wasn't in group "messagebus". After adding & relogin & manual start of cdemu-daemon - all works. (As for now, added command "cdemu-daemon &" to ~/.xprofile) |
|
Back to top |
|
|
CaptainBlood Advocate
Joined: 24 Jan 2010 Posts: 3519
|
Posted: Thu Aug 12, 2021 10:53 am Post subject: |
|
|
OK,
Here may be a different use case scenanrio/environment:
/etc/conf.d/modules Code: | modules_5_13_9_gentoo="${modules_5_13_9_gentoo}vhba " | /etc/udev/rules.d; Code: | cat /etc/udev/rules.d/*vhba.rules
KERNEL=="vhba_ctl", MODE="0660", OWNER="root", GROUP="cdrom" | /etc/group Code: | grep 'cdrom\|messagebus' /etc/group
cdrom:x:19:user
messagebus:x:249: | So no cdemu daemon permanently loaded.
My way for trying to be minimalistic.
Thks 4 ur attention, interest & support. _________________ USE="-*" in /etc/portage/make.conf here. |
|
Back to top |
|
|
CaptainBlood Advocate
Joined: 24 Jan 2010 Posts: 3519
|
Posted: Sun Dec 19, 2021 10:28 pm Post subject: |
|
|
3.2.6 is out...
liberty taken here to set things altogether... well as much as possible: Code: | cat /var/db/repos/local-repo/app-cdr/cdemu-daemon/cdemu-daemon-3.2.6-r0.ebuild
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit cmake systemd
DESCRIPTION="Daemon of the CDEmu optical media image mounting suite"
HOMEPAGE="https://cdemu.sourceforge.io"
SRC_URI="https://download.sourceforge.net/cdemu/cdemu-daemon/${P}.tar.xz"
LICENSE="GPL-2+"
SLOT="0/7" # subslot = CDEMU_DAEMON_INTERFACE_VERSION_MAJOR in CMakeLists.txt
KEYWORDS="~amd64 ~x86"
IUSE="systemd"
DEPEND=">=dev-libs/glib-2.38:2
>=dev-libs/libmirage-3.2.0:=
>=media-libs/libao-0.8.0:="
RDEPEND="${DEPEND}
sys-apps/dbus
>=sys-fs/vhba-20130607"
BDEPEND="
dev-util/intltool
sys-devel/gettext
virtual/pkgconfig"
DOCS=( AUTHORS README )
src_install() {
cmake_src_install
use systemd || eapply "${FILESDIR}/${P}-001-force-openrc.patch"
insinto /etc/modules-load.d
newins - vhba.conf <<<"vhba"
if use systemd ; then
systemd_douserunit service-example/cdemu-daemon.service
else
insinto /etc/udev/rules.d
newins - 69-vhba.rules <<<"KERNEL==\"vhba_ctl\", MODE=\"0660\", OWNER=\"root\", GROUP=\"cdrom\""
fi
insinto /usr/share/dbus-1/services
doins service-example/net.sf.cdemu.CDEmuDaemon.service
}
pkg_postinst() {
elog "As of 3.2.5, cdemu-daemon no longer supports autoloading"
elog "on non-systemd systems. OpenRC users have to start it manually."
elog
elog "We install /etc/modules-load.d/vhba.conf to load the module"
elog "automatically, and D-BUS autolaunch will start cdemu-daemon user"
elog "service."
} |
Code: | cat /var/db/repos/local-repo/app-cdr/cdemu-daemon/files/cdemu-daemon-3.2.6-001-force-openrc.patch
--- a/service-example/net.sf.cdemu.CDEmuDaemon.service 2021-12-18 14:18:52.000000000 +0300
+++ b/service-example/net.sf.cdemu.CDEmuDaemon.service 2021-12-19 20:13:23.929786814 +0300
@@ -1,4 +1,3 @@
[D-BUS Service]
Name=net.sf.cdemu.CDEmuDaemon
-SystemdService=cdemu-daemon.service
-Exec=/bin/true
+Exec=/usr/bin/cdemu-daemon --config-file "%h/.config/cdemu-daemon" | Unfortunately the --config-file option doesn't work... Neither does any harm
Any idea in this respect is more than welcome.
USE=systemd is there to keep initial install settings, untested though.
First iso mount request works out of the box here.
gcdemu must be used to increase the amount of possible mounts.
Thks 4 ur attention, interest & support. _________________ USE="-*" in /etc/portage/make.conf here. |
|
Back to top |
|
|
|