Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
How to temporary disable PulseAudio udev rule during boot?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
LdBeth
n00b
n00b


Joined: 09 Aug 2017
Posts: 15
Location: 浙江

PostPosted: Fri Dec 01, 2017 6:24 am    Post subject: How to temporary disable PulseAudio udev rule during boot? Reply with quote

I have a ZFS root file system and a ZFS logic volume mount on /root, however PulseAudio's udev rule creates a symlink .config/pulse/*-runtime to /tmp/pulse/*-runtime (not exist after boot) under /root during the boot. The left uncleaned /boot would prevent ZFS to mount the volume, which is annoying :( .

I don't have other reasons to reject PulseAudio. Also mount a ZFS volume on Gentoo requires udev, so I can't

I have some ideas, but I don't know which one works or less sucks.


  • Now I mount the original /root volume to /home/root and create a symlink to /boot, at least the volume can be mount. But I don't know if there will be any side effects.
  • Maybe I can mount the whole ZFS part during initramfs with a "clean" udev. :o I wonder if it is even practical.
  • As the title described, I would prefer to find a solve by modifying the udev rule either directly or indirectly.


Thanks in advance.

Some related links:

https://www.cendio.com/bugzilla/show_bug.cgi?id=5038

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=561777
Back to top
View user's profile Send private message
LIsLinuxIsSogood
Guru
Guru


Joined: 13 Feb 2016
Posts: 456

PostPosted: Sat Dec 02, 2017 10:56 am    Post subject: Reply with quote

Hi LdBeth, in all honesty nothing here does appear to need any bit of fixing. Maybe I don't actually understand, but if the problem is with ZFS not being able to mount on a non-empty folder, then can you do something to separate the files/folders for the mount point and other services, like the audio service (pulseaudio) within your system?

I would suggest going the route of working first with any ZFS/mount options that are available before jumping into the aspect of udev, and pulseaudio and trying to control the way devices are entered into those temporary folders, or configuration folders.

One other thing that you may want to try (although there's no way of knowing if this will do what you want) is rebuild pulseaudio package with no udev support.

But I doubt that is actually the solution you are after.

Yet another work around could involve just deleting the files and then proceed with mounting. In case you hadn't considered it yet,

Quote:
I don't have other reasons to reject PulseAudio


How about the reasons in your post. But in all honest, I don't suggest you get rid of it. If you can figure out enough to know how it is necessary for the purpose that you will use it, and then whatever it is your doing in terms of audio on your computer you may then be able to go the extra step to configure it so that pulseaudio won't present more of these random issues or problems in the future for you. (I AM NOT SAYING THAT PULSEAUDIO IS AN ISSUE, SINCE YOU YOURSELF MENTIONED IT BUT THERE IS NO SIGN OF PROBLEMS GOING ON WITH IT, IS THAT CORRECT?)
Back to top
View user's profile Send private message
LIsLinuxIsSogood
Guru
Guru


Joined: 13 Feb 2016
Posts: 456

PostPosted: Sat Dec 02, 2017 11:07 am    Post subject: Reply with quote

Alternatively, and I just thought of this, but what you may have to do if your goal is not to mess too much with folders of the filesystem, would be to use the init system (like you mentioned) and then tell your filesystem (not the audio or device manager) to do some careful mounting there so that the files won't get written to that /root location, which in turn blocks the ZFS.

It sounds like what you actually need is to make sure that fstab has an entry for /root that blocks files from being written maybe. In other words, making the later ZFS mount much easier then. Have you thought of separating the folder /root to its own partition, or would this be undesirable in this case? The good news is that your system works (for the most part). On the other hand, it leaves you with a ton to think about when it comes to this kind of a thing.
Back to top
View user's profile Send private message
LIsLinuxIsSogood
Guru
Guru


Joined: 13 Feb 2016
Posts: 456

PostPosted: Sat Dec 02, 2017 11:16 am    Post subject: Reply with quote

Please be sure to include in your next post a basic fact about which init system you are using (is it openrc? or systemd) and the output would be nice for emerge --info, as well as emerge -pv [insert packages] for whatever package you may be thinking of changing, or have already installed, like pulseaudio. Thanks
Back to top
View user's profile Send private message
LdBeth
n00b
n00b


Joined: 09 Aug 2017
Posts: 15
Location: 浙江

PostPosted: Sun Dec 03, 2017 4:13 am    Post subject: Reply with quote

Thank you LIsLinuxIsSoGood.

LIsLinuxIsSogood wrote:
Please be sure to include in your next post a basic fact about which init system you are using (is it openrc? or systemd) and the output would be nice for emerge --info, as well as emerge -pv [insert packages] for whatever package you may be thinking of changing, or have already installed, like pulseaudio. Thanks


I use OpenRC. And here is the emerge --info output.

Code:
Portage 2.3.13 (python 3.5.4-final-0, default/linux/amd64/17.0, gcc-6.4.0, glibc-2.25-r9, 4.12.12-gentoo-FC.01 x86_64)
=================================================================
System uname: Linux-4.12.12-gentoo-FC.01-x86_64-Intel-R-_Core-TM-_i5-3210M_CPU_@_2.50GHz-with-gentoo-2.4.1
KiB Mem:     3942448 total,   3524860 free
KiB Swap:    4194300 total,   4194300 free
Timestamp of repository gentoo: Fri, 01 Dec 2017 00:00:01 +0000
Head commit of repository gentoo: e32996811a8ef16d1ba8275930ed4f9e1248c9b8
sh bash 4.3_p48-r1
ld GNU ld (Gentoo 2.29.1 p3) 2.29.1
ccache version 3.2.4 [enabled]
app-shells/bash:          4.3_p48-r1::gentoo
dev-lang/perl:            5.24.3::gentoo
dev-lang/python:          2.7.14::gentoo, 3.5.4::gentoo
dev-util/ccache:          3.2.4::gentoo
dev-util/cmake:           3.8.2::gentoo
dev-util/pkgconfig:       0.29.2::gentoo
sys-apps/baselayout:      2.4.1-r2::gentoo
sys-apps/openrc:          0.34.11::gentoo
sys-apps/sandbox:         2.10-r4::gentoo
sys-devel/autoconf:       2.69::gentoo
sys-devel/automake:       1.15.1-r1::gentoo
sys-devel/binutils:       2.29.1-r1::gentoo
sys-devel/gcc:            6.4.0::gentoo
sys-devel/gcc-config:     1.8-r1::gentoo
sys-devel/libtool:        2.4.6-r3::gentoo
sys-devel/make:           4.2.1::gentoo
sys-kernel/linux-headers: 4.4::gentoo (virtual/os-headers)
sys-libs/glibc:           2.25-r9::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000
    sync-rsync-extra-opts:

gentoo-zh
    location: /var/lib/layman/gentoo-zh
    masters: gentoo
    priority: 50

pinkpieea
    location: /var/lib/layman/pinkpieea
    sync-type: laymansync
    sync-uri: https://notabug.org/soredake/gentoo-overlay.git
    masters: gentoo
    priority: 50

tlp
    location: /var/lib/layman/tlp
    masters: gentoo
    priority: 50

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=ivybridge -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=ivybridge -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs ccache config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync multilib-strict news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="C"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
USE="X a52 aac acl acpi alsa amd64 berkdb bluetooth bzip2 cairo cdda cjk clang cli cracklib crypt cxx dbus dri dvd encode exif ffmpeg flac fontconfig fortran gdbm gif glamor gnutls graphviz iconv ipv6 jpeg jpeg2k lcms mad matroska modules mp3 mp4 mpeg multilib ncurses networkmanager nls nptl ogg opengl openmp pam pango pcre pdf png postscript pulseaudio quicktime raw readline savedconfig seccomp session ssl svg tcpd theora tiff truetype udev unicode vaapi vorbis wifi wmf x264 x265 xattr xpm xvid zlib" ABI_X86="64 32" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx mmx mmxext pclmul popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" GRUB_PLATFORMS="efi-64" INPUT_DEVICES="libinput keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-6 php7-0" POSTGRES_TARGETS="postgres9_5" PYTHON_SINGLE_TARGET="python3_5" PYTHON_TARGETS="python3_5 python2_7" RUBY_TARGETS="ruby22" USERLAND="GNU" VIDEO_CARDS="intel i965" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
[/code]
Back to top
View user's profile Send private message
LIsLinuxIsSogood
Guru
Guru


Joined: 13 Feb 2016
Posts: 456

PostPosted: Sun Dec 03, 2017 8:58 am    Post subject: Reply with quote

Well, it may not be a completely clean fix for the problem, but have you tried to change the configuration within pulseaudio first before doing anything else.

I would suggest the following change, and then reboot to see if it perhaps doesn't load at startup. I am about to give it a shot and can also confirm whether or not this works.

1) Go into the file for /etc/pulse/daemon.conf
2) uncomment and change the line for autospawn, for it to be autospawn = no

NOTE the comments in the file are with a ";" so be sure to remove.

If that may not actually work, I have another suggested route involving the Desktop Environment and whatever else could be triggering pulseaudio to be active at the time of your boot, which doesn't seem necessary.

EDIT: So following a reboot with autospawn turned off while it is not running the pulseaudio daemon or client or any process, it does still appear to have created that file in /tmp folder of mine. You may need to consider an alternative route like either option 1 that you gave before, of relocating things to a different path (there doesn't appear to be a whole lot at stake with doing it, since it isn't like you are moving the /lib or another critical thing for system operations) or else only other thing I can think of at the moment is to write a short script that deletes the file there and then mounts ZFS on top of the then empty location, If that makes more sense than going that route should be pretty simple, with a bash script

#!/bin/bash
rm -r /tmp/*
mount -t "?" {ZFS mount point}

Consider this my best effort at scripting, for it being so late at night while I'm writing this. And maybe you can also see if the settings for udev are really worthwhile as compared to some far simpler solutions like your current one, or the script one.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum