You are not logged in.
I'm trying to complete my conversion to systemd. The only lines left in my /etc/rc.conf are:
NETWORK_PERSIST="no"
(where does this belong now?)
and my daemons:
DAEMONS=(syslog-ng @crond dbus avahi-daemon alsa network @ntpd netfs)
as you can see, some of my daemons are backgrounded at boot and I'm not sure how to accomplish that with systemd or whether it's even necessary.
These are the systemd equivalents and I have questions about some of them
syslog-ng.service
(I believe syslog-ng can be discarded under systemd, yes?)
cronie.service
dbus.service
(dbus.service does not need to be explicitly enabled according to systemd wiki?)
avahi-daemon.service
alsa-store.service alsa-restore.service
(do I need to load both alsa services enabled?)
ntpd.service
My netfs daemon is no longer needed under systemd?
I have all the systemd configuration files set up, specifically:
/etc/hostname, /etc/vconsole.conf, /etc/locale.conf, /etc/timezone, /etc/adjtime, /etc/modules-load.d/<program>.conf, /etc/systemd/logind.conf
So all should be left to do is to reboot and remove the
init=/bin/systemd
from
/etc/default/grub
then run:
# grub-mkconfig -o /boot/grub/grub.cfg
then manually remove initscripts, and then install systemd-sysvcompat and reboot again.
Is there any issue I've overlooked? I login from the shell and start X via ~/.bash_profile
What does systemd do with /etc/rc.local, ~/.xinitrc, ~/.fluxbox/startup, ~/.bash_profile? I need all these files to run correctly under systemd
Last edited by bpont (2012-09-19 22:03:12)
Offline
I'm trying to complete my conversion to systemd. The only lines left in my /etc/rc.conf are:
NETWORK_PERSIST="no"
(where does this belong now?)
Ditch it. Systemd will take care of it itself.
syslog-ng.service
(I believe syslog-ng can be discarded under systemd, yes?)
Yep.
dbus.service
(dbus.service does not need to be explicitly enabled according to systemd wiki?)
Yep.
alsa-store.service alsa-restore.service
(do I need to load both alsa services enabled?)
Ignore the alsa services. They're used by default.
My netfs daemon is no longer needed under systemd?
Hmm, not sure.
So all should be left to do is to reboot and remove the
init=/bin/systemd
from
/etc/default/grub
then run:
# grub-mkconfig -o /boot/grub/grub.cfg
then manually remove initscripts, and then install systemd-sysvcompat and reboot again.
Make sure you have everything installed and working via systemd before making any other changes. Services enabled and running, etc. This means removing them from rc.conf as you enable them in systemd. Once that is done, you just remove the init line and install grub, remove initscripsts, install systemd-sysvcompat, then reboot.
What does systemd do with /etc/rc.local, ~/.xinitrc, ~/.fluxbox/startup, ~/.bash_profile? I need all these files to run correctly under systemd
rc.local should go away under systemd once you uninstall initscripts. All of the others have to do with programs that have nothing to do with systemd at all.
Last edited by Scimmia (2012-09-19 22:34:38)
Online
rc.local should go away under systemd once you uninstall initscripts.
But I mount /home/user on a separate partition via /etc/rc.local. How do I accomplish that after removing initscripts?
Offline
why not just do it via fstab?
Online
Also, when I ran
# systemctl enable cronie.service
I got this error message:
Failed to issue method call: No such file or directory
Offline
why not just do it via fstab?
Because it's encrypted.
Offline
why not just do it via crypttab?
Also, when I ran
# systemctl enable cronie.service
I got this error message:
Failed to issue method call: No such file or directory
Is cronie installed and up-to-date?
Last edited by WorMzy (2012-09-19 23:26:42)
Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD
Making lemonade from lemons since 2015.
Offline
why not just do it via crypttab?
bpont wrote:Also, when I ran
# systemctl enable cronie.service
I got this error message:
Failed to issue method call: No such file or directory
Is cronie installed and up-to-date?
I don't think crypttab supports truecrypt does it?
I had dcron installed which is why I got the error message. I corrected it.
Offline
I don't know anything about drive encryption, but if you need to, you can always write a systemd service to run a script. I think the instructions are in the wiki.
Online
I don't know anything about drive encryption, but if you need to, you can always write a systemd service to run a script. I think the instructions are in the wiki.
I've never written a .service file before. Will this work as a drop-in replacement to my /etc/rc.local entry? Is the syntax right?
[Unit] Description=Mount truecrypt volume to /home/user during boot
[Service] ExecStart=/usr/bin/truecrypt /dev/sdxx /home/user
Type=oneshot
RemainAfterExit=yes
[Install] WantedBy=multi-user.target
Offline
AFAIK, that should do it.
Online
AFAIK, that should do it.
Actually, this is what worked:
[Unit]
Description=Mount truecrypt volume to /home/user during boot
ConditionFileIsExecutable=/usr/bin/truecrypt
[Service]
Type=oneshot
ExecStart=/usr/bin/truecrypt /dev/sdxx /home/user
StandardInput=tty
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
Offline
Scimmia wrote:AFAIK, that should do it.
Actually, this is what worked:
[Unit] Description=Mount truecrypt volume to /home/user during boot ConditionFileIsExecutable=/usr/bin/truecrypt [Service] Type=oneshot ExecStart=/usr/bin/truecrypt /dev/sdxx /home/user StandardInput=tty RemainAfterExit=yes [Install] WantedBy=multi-user.target
Actually, after I completed the transition to pure systemd (mainly removing the kernel line, initscripts, etc.) and rebooted, my system hung when this service was called. I do not know the proper syntax to make it work yet.
Offline
I'm going to guess the problem is with the "StandardInput=tty" line. From man systemd.exec:
StandardInput=
Controls where file descriptor 0 (STDIN) of the executed processes is connected to. Takes one of null, tty, tty-force, tty-fail or socket. If null is selected standard input will be connected to /dev/null, i.e. all read attempts by the process will result in immediate EOF. If tty is selected standard input is connected to a TTY (as configured by TTYPath=, see below) and the executed process becomes the controlling process of the terminal. If the terminal is already being controlled by another process the executed process waits until the current controlling process releases the terminal. tty-force is similar to tty, but the executed process is forcefully and immediately made the controlling process of the terminal, potentially removing previous controlling processes from the terminal. tty-fail is similar to tty but if the terminal already has a controlling process start-up of the executed process fails. The socket option is only valid in socket-activated services, and only when the socket configuration file (see systemd.socket(5) for details) specifies a single socket only. If this option is set standard input will be connected to the socket the service was activated from, which is primarily useful for compatibility with daemons designed for use with the traditional inetd(8) daemon. This setting defaults
does truecrypt need tty input?
Last edited by Scimmia (2012-09-20 16:19:53)
Online
I'm going to guess the problem is with the "StandardInput=tty" line. From man systemd.exec:
StandardInput=
Controls where file descriptor 0 (STDIN) of the executed processes is connected to. Takes one of null, tty, tty-force, tty-fail or socket. If null is selected standard input will be connected to /dev/null, i.e. all read attempts by the process will result in immediate EOF. If tty is selected standard input is connected to a TTY (as configured by TTYPath=, see below) and the executed process becomes the controlling process of the terminal. If the terminal is already being controlled by another process the executed process waits until the current controlling process releases the terminal. tty-force is similar to tty, but the executed process is forcefully and immediately made the controlling process of the terminal, potentially removing previous controlling processes from the terminal. tty-fail is similar to tty but if the terminal already has a controlling process start-up of the executed process fails. The socket option is only valid in socket-activated services, and only when the socket configuration file (see systemd.socket(5) for details) specifies a single socket only. If this option is set standard input will be connected to the socket the service was activated from, which is primarily useful for compatibility with daemons designed for use with the traditional inetd(8) daemon. This setting defaults
does truecrypt need tty input?
I removed the StandardInput=tty line, but now it exits with a status 1 failure.
Offline
Scimmia wrote:AFAIK, that should do it.
Actually, this is what worked:
[Unit] Description=Mount truecrypt volume to /home/user during boot ConditionFileIsExecutable=/usr/bin/truecrypt [Service] Type=oneshot ExecStart=/usr/bin/truecrypt /dev/sdxx /home/user StandardInput=tty RemainAfterExit=yes [Install] WantedBy=multi-user.target
You might want to change the ExecStart line to the correct partition.
What partition is your /home/user dir?
Also is your username user?
We wants it, we needs it. Must have the precious. Arch Linux.
Offline
bpont wrote:Scimmia wrote:AFAIK, that should do it.
Actually, this is what worked:
[Unit] Description=Mount truecrypt volume to /home/user during boot ConditionFileIsExecutable=/usr/bin/truecrypt [Service] Type=oneshot ExecStart=/usr/bin/truecrypt /dev/sdxx /home/user StandardInput=tty RemainAfterExit=yes [Install] WantedBy=multi-user.target
You might want to change the ExecStart line to the correct partition.
What partition is your /home/user dir?
Also is your username user?
Um. My partition and username are correct. I just printed a generic description of them on a public forum.
I should also mention that my original configuration worked when I had a mixed system, but since removing initscripts, etc. and moving over to a pure systemd environment, now I can't get this service file to work.
Last edited by bpont (2012-09-20 21:14:08)
Offline
DAEMONS=(syslog-ng @crond dbus avahi-daemon alsa network @ntpd netfs)
as you can see, some of my daemons are backgrounded at boot and I'm not sure how to accomplish that with systemd or whether it's even necessary.
systemd takes care of dependencies, you don't need to specify order/backgrounding any longer.
My netfs daemon is no longer needed under systemd?
Correct.
Offline
Maybe your service file needs to specify that it should be used after something else is ready? Not sure though - still struggling with this transition myself.
By the way, you can leave removing the init from the command line until last - it won't interfere with anything, it just isn't necessary once the compatibility symlink is in place.
Anything here useful?
CLI Paste | How To Ask Questions
Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L
Offline
Anything here useful?
I haven't tried the fstab route yet. I'd rather see if I can get my .service file to work because that's sort of the point of this much touted systemd.
Offline
cfr wrote:Anything here useful?
I haven't tried the fstab route yet. I'd rather see if I can get my .service file to work because that's sort of the point of this much touted systemd.
/etc/fstab is the canonical place to configure filesystems, just like /etc/crypttab still is the place to configure encryption mappings. Unless you have a specific reason not to, I suggest using fstab rather than writing .mount files. Systemd should then DTRT and also anything else that integrates with fstab will "just work".
Offline
bpont wrote:cfr wrote:Anything here useful?
I haven't tried the fstab route yet. I'd rather see if I can get my .service file to work because that's sort of the point of this much touted systemd.
/etc/fstab is the canonical place to configure filesystems, just like /etc/crypttab still is the place to configure encryption mappings. Unless you have a specific reason not to, I suggest using fstab rather than writing .mount files. Systemd should then DTRT and also anything else that integrates with fstab will "just work".
That method did not work. I followed the instructions:
Mount volumes via fstab
First of all, we need to write a script which will handle the way mounting via fstab is done. Place the following in /sbin/mount.truecrypt:
#!/usr/bin/env sh
DEV="$1"
MNTPT="$2"
OPTIONS=""
TCOPTIONS=""
shift 3
IFS=','
for arg in $*; do
if [ "${arg}" == "system" ]; then
TCOPTIONS="${TCOPTIONS}-m=system "
elif [[ "${arg}" == fs=* ]]; then
FS=${arg#*=}
TCOPTIONS="${TCOPTIONS}--filesystem=${FS} "
else
OPTIONS="${OPTIONS}${arg},"
fi
done
truecrypt ${DEV} ${MNTPT} ${TCOPTIONS% *} --fs-options="${OPTIONS%,*}"
Also do not forget to make the file executable:
chmod +x /sbin/mount.truecrypt
Finally, add the device to fstab somewhat like this:
/dev/sdb3 /mnt truecrypt fs=vfat,defaults 0 0
My /etc/fstab line:
/dev/sdxx /home/user truecrypt fs=ext3,defaults 0 0
Error messages on boot:
[Failed] Failed to mount /home/xxxxx See systemctl status home-xxxxx.mount for details
[DEPEND] Dependency failed for local file systems
[DEPEND] Dependency failed for basic system
[DEPEND] Dependency failed for permit user sessions
[DEPEND] Dependency failed for multi-user
[DEPEND] Dependency failed for graphical interface
I should reiterate that my original .service file worked when I had a mixed system. It was only after the full conversion that it stopped working.
Offline
Well? Did you see systemctl status home-xxxx.mount for details?
CLI Paste | How To Ask Questions
Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L
Offline
Well? Did you see systemctl status home-xxxx.mount for details?
LOADED: Loaded (/etc/fstab)
Active: failed (result:exit-code)
Where: /home/xxxx
What: /dev/sdxx
Process: 211 ExecMount=/bin/mount /dev/sdxx /home/xxxx -t truecrypt -o fs=ext3,defaults (code=exited, status=1/FAILURE)
CGroup: name=systemd/system/home-xxxx.mount
Offline
What happens if you run
/bin/mount /dev/sdxx /home/xxxx -t truecrypt -o fs=ext3,defaults
by hand?
CLI Paste | How To Ask Questions
Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L
Offline