You are not logged in.
Pages: 1
Hello everybody!
A am trying to execute script stored in /etc/profile.d.
I created alsa.sh script:
alsactl --file /etc/profile.d/asound.state restore
and put it in /etc/profile.d directory. But nothing happens.
If I add any other line to this script this line executes perfectly. If I execute this script in bash
sh alsa.sh
it runs just fine.
What could be the reason?
Last edited by Suncatcher (2015-06-04 12:15:01)
Offline
If you add any other line or
#!/bin/sh
at the top?
What exactly are you trying to do with that script?
Offline
What problem are you trying to solve? Why are the default systemd alsa store and restore services not working for you?
Offline
If you add any other line or
Nope. Nothing happens if I add #!/bin/sh at the top.
But if I add any executable line (like chromium or any other app) it is executed before Enlightenment load.
What exactly are you trying to do with that script?
To restore ALSA levels on system startup.
Last edited by Suncatcher (2015-05-05 19:06:32)
Offline
Why are the default systemd alsa store and restore services not working for you?
This is extremely interesting question.
I tried to edit alsa-restore.service manually (to make it restore from file) but didn't succeeded.
But if a restore in bash (either from file or from initial asound.state) it works perfectly.
I've tried many ways of autostarting from https://wiki.archlinux.org/index.php/Autostarting
.xinitrc
~/.config/autostart
/etc/profile
but they don't work.
Last edited by Suncatcher (2015-05-05 19:02:48)
Offline
"but didn't succeed" and "but they don't work" tells us nothing we can use to try to help you. If you can tell us more about exactly how these attempts fail (and specifically how you edited alsa-restore.service) we might be able to help.
Offline
Look in your journal to determine why the service is not working, don't attempt kludgy fixes to mask the problem.
Offline
Post the output of:
systemctl status alsa-restore.service alsa-state.service alsa-store.service
Offline
If you can tell us more about exactly how these attempts fail
It simply didn't start (ALSA levels left unchanged). What other details do you need?
and specifically how you edited alsa-restore.service
Original file was
#
# Note that two different ALSA card state management schemes exist and they
# can be switched using a file exist check - /etc/alsa/state-daemon.conf .
#
[Unit]
Description=Restore Sound Card State
ConditionPathExists=!/etc/alsa/state-daemon.conf
DefaultDependencies=no
After=alsa-state.service
Before=shutdown.target
Conflicts=shutdown.target
[Service]
Type=oneshot
ExecStart=-/usr/bin/alsactl restore
StandardOutput=syslog
And I replaced Exec line with
ExecStart=-/usr/bin/alsactl --file /etc/profile.d/asound.state restore
Offline
Post the output of:
systemctl status alsa-restore.service alsa-state.service alsa-store.service
● alsa-restore.service - Restore Sound Card State
Loaded: loaded (/usr/lib/systemd/system/alsa-restore.service; static; vendor preset: disabled)
Active: inactive (dead) since Tue 2015-05-05 21:46:50 MSK; 1h 36min ago
Process: 177 ExecStart=/usr/bin/alsactl restore (code=exited, status=0/SUCCESS)
Main PID: 177 (code=exited, status=0/SUCCESS)
May 05 21:46:50 localhost systemd[1]: Starting Restore Sound Card State...
May 05 21:46:50 localhost systemd[1]: Started Restore Sound Card State.
● alsa-store.service - Store Sound Card State
Loaded: loaded (/usr/lib/systemd/system/alsa-store.service; static; vendor preset: disabled)
Active: inactive (dead)
Offline
And I replaced Exec line with
ExecStart=-/usr/bin/alsactl --file /etc/profile.d/asound.state restore
Did you also change alsa-store.service accordingly (or somehow manually create this state file) and then reboot? Related to this: the status output you just posted, is that with the modified service file?
Why do you even want to use such an inappropriate location for the state file? You think the service doesn't restore levels because of the default location?
Last edited by Raynman (2015-05-05 20:30:25)
Offline
Look in your journal to determine why the service is not working, don't attempt kludgy fixes to mask the problem.
journalctl | grep -i alsa
gives this output
May 04 17:51:45 localhost alsactl[190]: /usr/bin/alsactl: load_state:1683: Cannot open /var/lib/alsa/asound.state for reading: No such file or directory
May 04 17:51:45 localhost alsactl[190]: /usr/bin/alsactl: sysfs_init:48: sysfs path '/sys' is invalid
May 04 17:51:45 localhost alsactl[190]: Found hardware: "ICH" "SigmaTel STAC9700,83,84" "AC97a:83847600" "0x8086" "0x0000"
May 04 17:51:45 localhost alsactl[190]: Hardware is initialized using a generic method
May 04 20:10:14 localhost alsactl[178]: /usr/bin/alsactl: load_state:1735: No soundcards found...
May 04 20:58:08 localhost alsactl[179]: /usr/bin/alsactl: load_state:1735: No soundcards found...
May 04 21:12:42 localhost alsactl[178]: /usr/bin/alsactl: load_state:1735: No soundcards found...
May 04 21:18:29 localhost sudo[313]: suncatcher : TTY=unknown ; PWD=/home/suncatcher ; USER=root ; COMMAND=/usr/bin/alsactl --file /etc/profile.d/asound.state restore
Offline
Did you also change alsa-store.service accordingly?
No. I wanted to restore from my modified levels' configuration, not from generic one.
Related to this: the status output you just posted, is that with the modified service file?
No, posted output is from the original alsa-restore.service. As my attempts were unsuccessfull I reverted to original one.
Why do you even want to use such an inappropriate location for the state file? You think the service doesn't restore levels because of the default location?
No, I didn't think the reason was in default location. I simply tried all possible ways to solve the problem. I thought (and now I think so too) the location of asound.state file is nonessential because manual restoring via my alsa.sh script works just fine.
Offline
jasonwryan wrote:Look in your journal to determine why the service is not working, don't attempt kludgy fixes to mask the problem.
journalctl | grep -i alsa
gives this output
May 04 17:51:45 localhost alsactl[190]: /usr/bin/alsactl: load_state:1683: Cannot open /var/lib/alsa/asound.state for reading: No such file or directory May 04 17:51:45 localhost alsactl[190]: /usr/bin/alsactl: sysfs_init:48: sysfs path '/sys' is invalid May 04 17:51:45 localhost alsactl[190]: Found hardware: "ICH" "SigmaTel STAC9700,83,84" "AC97a:83847600" "0x8086" "0x0000" May 04 17:51:45 localhost alsactl[190]: Hardware is initialized using a generic method May 04 20:10:14 localhost alsactl[178]: /usr/bin/alsactl: load_state:1735: No soundcards found... May 04 20:58:08 localhost alsactl[179]: /usr/bin/alsactl: load_state:1735: No soundcards found... May 04 21:12:42 localhost alsactl[178]: /usr/bin/alsactl: load_state:1735: No soundcards found... May 04 21:18:29 localhost sudo[313]: suncatcher : TTY=unknown ; PWD=/home/suncatcher ; USER=root ; COMMAND=/usr/bin/alsactl --file /etc/profile.d/asound.state restore
BTW, when I execute
alsactl restore
I also get journal-like error:
alsactl: state_lock:125: file /var/lib/alsa/asound.state lock error: File exists
alsactl: load_state:1683: Cannot open /var/lib/alsa/asound.state for reading: File exists
alsactl: sysfs_init:48: sysfs path '/sys' is invalid
Found hardware: "ICH" "SigmaTel STAC9700,83,84" "AC97a:83847600" "0x8086" "0x0000"
Hardware is initialized using a generic method
Offline
system.d analysis didn't highlight any failed services:
systemctl --failed
gives output
0 loaded units listed. Pass --all to see loaded but inactive units, too.
To show all installed unit files use 'systemctl list-unit-files'.
Last edited by Suncatcher (2015-05-24 20:30:17)
Offline
systemd alsa services' check is also fine and gives following outputs:
systemctl status alsa-restore
● alsa-restore.service - Restore Sound Card State
Loaded: loaded (/usr/lib/systemd/system/alsa-restore.service; static; vendor preset: disabled)
Active: inactive (dead) since Sun 2015-05-24 23:14:01 MSK; 17min ago
Process: 195 ExecStart=/usr/bin/alsactl restore (code=exited, status=0/SUCCESS)
Main PID: 195 (code=exited, status=0/SUCCESS)
May 24 23:14:01 localhost systemd[1]: Starting Restore Sound Card State...
May 24 23:14:01 localhost systemd[1]: Started Restore Sound Card State.
systemctl status alsa-store
● alsa-store.service - Store Sound Card State
Loaded: loaded (/usr/lib/systemd/system/alsa-store.service; static; vendor preset: disabled)
Active: inactive (dead)
systemctl status alsa-state
● alsa-state.service - Manage Sound Card State (restore and store)
Loaded: loaded (/usr/lib/systemd/system/alsa-state.service; static; vendor preset: disabled)
Active: inactive (dead)
Condition: start condition failed at Sun 2015-05-24 23:14:01 MSK; 20min ago
ConditionPathExists=/etc/alsa/state-daemon.conf was not met
May 24 23:14:01 localhost systemd[1]: Started Manage Sound Card State (restore and store).
Last edited by Suncatcher (2015-05-24 20:37:19)
Offline
Offline
Why does it initialize the device in a generic way
Found hardware: "ICH" "SigmaTel STAC9700,83,84" "AC97a:83847600" "0x8086" "0x0000"
Hardware is initialized using a generic method
?
I think the reason is here.
Last edited by Suncatcher (2015-06-04 12:13:44)
Offline
Pages: 1