Difference between revisions of "Talk:Systemd"

From ArchWiki
Jump to: navigation, search
(video group is still needed!: new section)
(Duplication of content in Native configuration section: re)
(47 intermediate revisions by 20 users not shown)
Line 1: Line 1:
== Display manager fails to load with fast SSD ==
+
== Initscripts emulation ==
  
I was having a problem with my display manager (LXDM) not loading on my laptop, which has a Sandisk Extreme SSD.
+
Hi, I pushed the sysvinit rc.local facility to systemd.
Xorg.log would show errors like "No screens found."
+
  
I eventually figured out that the problem was that my computer was booting so fast that KMS didn't have enough time to kick in before X was started. I solved by adding the KMS driver (i915 in my case) to the initramfs.
+
# cat /etc/systemd/system/multi-user.target.wants/rc-local.service
 +
[Unit]
 +
Description=/etc/rc.local Compatibility
 +
ConditionFileIsExecutable=/etc/rc.local
 +
[Service]
 +
Type=oneshot
 +
ExecStart=/usr/bin/bash /etc/rc.local
 +
TimeoutSec=0
 +
StandardInput=tty
 +
RemainAfterExit=yes
  
Just a tip for SSD users, not sure if it should be added to the page or not.<br> --[[User:Steev|Steev]] ([[User talk:Steev|talk]]) 16:59, 2 September 2012 (UTC)
+
The rc.local script displays (important) informations on the console and expects a validation with the return key.
:This is a general problem that needs to be solved in the display manager. GDM already implements the bits for the [http://cgit.freedesktop.org/systemd/systemd/commit/?id=f1a8e221ecacea23 CanGraphical] flag.
+
:-- [[User:Falconindy|Falconindy]] ([[User talk:Falconindy|talk]]) 21:34, 2 September 2012 (UTC)
+
  
== Hibernation with systemd ==
+
# cat /etc/rc.local
 +
#!/bin/bash
 +
echo IMPORTANT INFORMATIONS
 +
read -s key
  
The hibernation section should be considered a hack since systemd does not directly handle the backend that handles power management. Systemd uses the Upower interface to handle such requests<br>-- [[User:Yungtrizzle|Yungtrizzle]] ([[User talk:Yungtrizzle|talk]]) 06:25, 10 October 2012‎
+
The informations are well displayed on console but the graphic manager starts before the keyboard confirmation...
  
:I talked about hibernation process with Lennart Poettering and he said that systemd-hibernate does only "echo disk > /sys/power/state" . As far as i can see, it works perfectly with tuxonice, since it seems it is now using the same userspace API as kernel hibernation; so it works even without hibernate-script installed (i use it without that package).  
+
Note that tty1 is disabled.
:-- [[User:Nierro|Nierro]] ([[User talk:Nierro|talk]]) 13:54, 24 October 2012
+
# ll /etc/systemd/system/getty.target.wants/
 +
total 0
 +
-rw-r--r-- 1 root root  0 17 mars  12:52 getty@tty1.service
 +
lrwxrwxrwx 1 root root 38  2 sept.  2012 getty@tty2.service -> /usr/lib/systemd/system/getty@.service
 +
  -rw-r--r-- 1 root root  0 17 mars  12:17 getty@tty4.service
 +
-rw-r--r-- 1 root root  0 17 mars  12:17 getty@tty5.service
 +
-rw-r--r-- 1 root root  0 17 mars  12:17 getty@tty6.service
  
:: what is the #Hibernation section all about anyway? It makes it sound like you need to use uswsusp to hibernate while it should work out of the box just fine. It doesn't explain at all why you would want to use uswsusp instead of the default command. I don't use hibernate nor do I know what uswsusp actually does, so what am I missing here? ::-- [[User:65kid|65kid]] ([[User talk:65kid|talk]]) 15:12, 25 October 2012 (UTC)
+
How can I start the graphic manager after the keyboard confirmation?
  
:::I agree with 65kid. In fact, systemctl hibernate works out of the box (it only does an "echo disk...", nothing else). We don't need uswsusp at all. I tried with stock arch kernel and it works.
+
== Should the section "writing a custom .service" be expanded? ==
:::-- [[User:Nierro|Nierro]] ([[User talk:Nierro|talk]]) 11:24, 26 October 2012
+
  
::::Then I suggest that - unless someone explains why you would want to use uswsusp - we remove this whole section because it is nothing but confusing. This article is already way too big to waste text on something that doesn't seem to make any sense.
+
I think so.. as long as I got, this is necessary to run self-made scripts during the boot process, but this is not clear and the structure of the files is not well presented.
::::-- [[User:65kid|65kid]] ([[User talk:65kid|talk]]) 10:10, 26 October 2012 (UTC)
+
  
::::: I went ahead and removed the irrelevant information from the page, moving it to [[Uswsusp]]. I also added a note pointing readers there if they want to use another backend for suspending or hibernating.
+
Moreover, when explain how to transit from the initscript, some referrals on how to move the old custom hooks in {{ic|/etc/rc.d/functions.d}} to be executed by systemd, should be made.<br>
:::::-- [[User:Ifaigios|Ifaigios]] ([[User talk:Ifaigios|talk]]) 18:16, 26 October 2012 (UTC)
+
-- [[User:DarioP|DarioP]] ([[User talk:DarioP|talk]]) 12:42, 18 November 2012 (UTC)
  
:::::: Hey [[User:Nierro|Nierro]], do {{ic|systemctl hibernate}} and {{ic|systemctl suspend}} really do different things on your box? In my setup (linux-pf, systemd 195-2), if I do the latter, my box is also in suspend mode, meaning that my power button is glowing on and off and I don't see grub after pressing the power button again but are back to my desktop almost immediately. To me, it rather seems as if {{ic|systemctl hibernate}} goes into hybrid mode?
+
:I think it needs to be expanded indeed. As a newbie, it is easy to grasp the concept of "put your code in rc.local", and it's not clear how to transition. Specific questions, as also mentioned by DarioP: In what directory should I place my service definition? On the examples page, there are some files named with an at-sign ({{ic|@}}), what difference does that make? It would be very helpful to have a complete example for running a single command at boot (my example: {{ic|echo noop > /sys/block/sdb/queue/scheduler}}).
::::::-- [[User:Jakobh|jakobh]] [[User talk:Jakobh|]] 10:07, 29 October 2012 (UTC)
+
:-- [[User:Fa2k|Fa2k]] ([[User talk:Fa2k|talk]]) 3 February 2013
  
:::::: Got an answer to the question on the systemd mailing list now: [http://lists.freedesktop.org/archives/systemd-devel/2012-October/007245.html Link]
+
== Systemd defaults / to rshared, gotcha ==
::::::-- [[User:Jakobh|jakobh]] [[User talk:Jakobh|✉]] 17:56, 30 October 2012 (UTC)
+
  
== <s>Removing rc.local</s> ==
+
Still reading up on this, so I'm not 100% solid but I discovered during the systemd transition that it defaults the / mount to rshared (see [http://www.kernel.org/doc/Documentation/filesystems/sharedsubtree.txt Shared subtree] for definitions).  Excerpted from core/mount-setup.c in systemd github: {{bc|/* Mark the root directory as shared in regards to mount
 +
* propagation. The kernel defaults to "private", but we think
 +
* it makes more sense to have a default of "shared" so that
 +
* nspawn and the container tools work out of the box. If
 +
* specific setups need other settings they can reset the
 +
* propagation mode to private if needed. */
 +
if (detect_container(NULL) <&#61; 0)
 +
        if (mount(NULL, "/", NULL, MS_REC&#124;MS_SHARED, NULL) < 0)
 +
                log_warning("Failed to set up the root directory for shared mount propagation: %m");}}
 +
This means that all bind mounts made through fstab will default to shared behavior, not private.  For those users who depend on non-recursive bind mounts, this can be a very big gotcha (as the mount propagation effectively nullifies the non-recursion).
 +
I think it should be at least noted under Filesystem Mounts, since fstab bind entries definitely may not preserve behavior across the systemd transition and there are definitely some systems that would fail to start up/operate properly due to this, perhaps even silently.
  
It isn't clear how to get rid of rc.local.  It would be useful to include this statement from the forum discussion in moving from a mixed system to a pure system:
+
As a side note, for nested bind mounts this also results in multiplicative bloat of the mount table, depending on what kind of nesting structure
 +
is used (it's actually relatively easy to construct a nesting sequence that makes 2^n mounts out of n mount calls).
  
Go through {{ic|/etc/rc.local}} and {{ic|/etc/rc.local.shutdown}} and turn them into service files (or, if you intend to keep them as they are, copy {{ic|/usr/lib/systemd/system/rc-local{,.shutdown}.service}} to {{ic|/etc/systemd/system/}}).<br>--‎ [[User:Myshkin|Myshkin]] ([[User talk:Myshkin|talk]]) 00:21, 13 Oct 2012
+
Still looking into good (and easy) configuration solutions.
* I added a new section [[Systemd#.2Fetc.2Frc.local_emulation_for_systemd]] that covers how to emulate {{ic|/etc/rc.local}} in a pure systemd environment. Closing.
+
:-- [[User:Jstjohn|Jstjohn]] ([[User talk:Jstjohn|talk]]) 21:04, 30 October 2012 (UTC)
+
  
== Replacing ConsoleKit with systemd-logind -> networkmanager ==
+
[[User:Compgamer89|Compgamer89]] ([[User talk:Compgamer89|talk]]) 07:16, 4 December 2012 (UTC)
  
As of {{pkg|networkmanager}} 0.9.6.0-2 in [extra] we do no more have to recompile it with systemd support from [[ABS]], is this right? So the note should be upgraded.
+
:You may find [http://cgit.freedesktop.org/systemd/systemd/commit/?id=b3ac5f8cb98757416d8660023d6564a7c411f0a0 this commit] useful. --[[User:David Strauss|David Strauss]] ([[User talk:David Strauss|talk]]) 22:58, 13 December 2012 (UTC)
Am i missing anything?<br> -- [[User:Nierro|Nierro]] ([[User talk:Nierro|talk]]) 09:31, 15 October 2012
+
  
: 0.9.6.0-2 in [extra] was compiled on 2012-09-19 and the change to systemd was on 2012-09-29, so as far as I can see, it still needs to be recompiled. https://projects.archlinux.org/svntogit/packages.git/commit/trunk?h=packages/networkmanager&id=c34580e6e35b9e87f7dc27f360507143d4fd9106
+
== Disputed groups section==
:[[User:65kid|65kid]] ([[User talk:65kid|talk]]) 20:00, 15 October 2012 (UTC)
+
This template/warning should be removed. If there is a genuine dispute, then there should be accompanying material, ie., arguments and evidence, on this page.
  
::Damn, you're right. I did not see that pkgrel=3 while we are still using -2. Sorry, it means i'm still using my recompiled package, while i thought i was using the [extra] one.
+
[[User:Jasonwryan|Jasonwryan]] ([[User talk:Jasonwryan|talk]]) 23:02, 18 March 2013 (UTC)
::-- [[User:Nierro|Nierro]] ([[User talk:Nierro|talk]]) 16:35, 15 October 2012
+
  
== video group is still needed! ==
+
: Done. [[User:Earnest|Earnest]] ([[User talk:Earnest|talk]]) 22:20, 23 March 2013 (UTC)
  
"Adding your user to groups (optical, audio, scanner, ...) is not necessary for most use cases with systemd. The groups can even cause some functionality to break."
+
==systemd no longer supports initscripts==
 +
http://cgit.freedesktop.org/systemd/systemd/commit/?id=53d05b44f17db67d644069600e4b5bbca88d21e7
  
This statement might be too generic. For example, without the video group, mesa will use the llvm driver instead of the Gallium AMD driver in my laptop.
+
-- [[User:D garbage|D garbage]]
 +
: Please add your signature next time by typing four tildes ({{ic|<nowiki>~~~~</nowiki>}})
 +
: Anyway, I think it may be worth considering to remove all initscripts related sections. Initscripts has been unsupported for almost half a year now, whoever still hasn't switched is screwed anyway. About time this article gets a little shorter. Other opinions?
 +
: [[User:65kid|65kid]] ([[User talk:65kid|talk]]) 10:16, 24 March 2013 (UTC)
 +
 
 +
::Considering that, on multiple occasions, I've seen people come into the #archlinux channel on IRC and state that they haven't updated their systems for almost a year, I think we should keep this info in the wiki for a couple more months at least.
 +
::-- [[User:Jstjohn|Jstjohn]] ([[User talk:Jstjohn|talk]]) 19:53, 24 March 2013 (UTC)
 +
 
 +
==Duplication of content in Native configuration section==
 +
I don't remember if this topic has already been discussed here, but it seems to me that [[systemd#Native configuration]] is duplicating information that IMO better belongs to other articles:
 +
*<s>[[systemd#Hostname]] and [[Network Configuration#Set the hostname]]</s>
 +
*[[systemd#Locale]] and [[Locale]] ([[Locale]] is not yet mentioning ''localectl'' though)
 +
*[[systemd#Virtual console]] and [[KEYMAP]] ([[KEYMAP]] is not yet mentioning ''localectl'' though)
 +
*[[systemd#Time zone]] and [[Time#Time Zone]]
 +
*[[systemd#Hardware clock]] and [[Time]] (this would be a good chance to update [[Time]])
 +
*[[systemd#Kernel modules]] and [[Kernel modules]]
 +
*[[systemd#Automount]] and [[fstab]]
 +
*[[systemd#LVM]] and [[LVM]]
 +
 
 +
I would suggest removing all these sections or replacing them with links to the reported articles, possibly merging any information that those articles are missing.
 +
 
 +
-- [[User:Kynikos|Kynikos]] ([[User talk:Kynikos|talk]]) 16:16, 13 April 2013 (UTC)
 +
: +1 for move them out. They are in a central page because at that time, initscripts is the only init supported. Now when a user want to know how to set up LVM, [[LVM]] is the natual target. Very few of them will ever goto [[Systemd]] and go to LVM section. -- [[User:Fengchao|Fengchao]] ([[User talk:Fengchao|talk]]) 12:52, 14 April 2013 (UTC)
 +
::Thanks, started with [[systemd#Hostname]], any help will be appreciated of course, I think there are also other sections that can be moved out. -- [[User:Kynikos|Kynikos]] ([[User talk:Kynikos|talk]]) 11:15, 15 April 2013 (UTC)

Revision as of 11:15, 15 April 2013

Initscripts emulation

Hi, I pushed the sysvinit rc.local facility to systemd.

# cat /etc/systemd/system/multi-user.target.wants/rc-local.service 
[Unit]
Description=/etc/rc.local Compatibility
ConditionFileIsExecutable=/etc/rc.local
[Service]
Type=oneshot
ExecStart=/usr/bin/bash /etc/rc.local
TimeoutSec=0
StandardInput=tty
RemainAfterExit=yes

The rc.local script displays (important) informations on the console and expects a validation with the return key.

# cat /etc/rc.local
#!/bin/bash
echo IMPORTANT INFORMATIONS
read -s key

The informations are well displayed on console but the graphic manager starts before the keyboard confirmation...

Note that tty1 is disabled.

# ll /etc/systemd/system/getty.target.wants/
total 0
-rw-r--r-- 1 root root  0 17 mars  12:52 getty@tty1.service
lrwxrwxrwx 1 root root 38  2 sept.  2012 getty@tty2.service -> /usr/lib/systemd/system/getty@.service
-rw-r--r-- 1 root root  0 17 mars  12:17 getty@tty4.service
-rw-r--r-- 1 root root  0 17 mars  12:17 getty@tty5.service
-rw-r--r-- 1 root root  0 17 mars  12:17 getty@tty6.service

How can I start the graphic manager after the keyboard confirmation?

Should the section "writing a custom .service" be expanded?

I think so.. as long as I got, this is necessary to run self-made scripts during the boot process, but this is not clear and the structure of the files is not well presented.

Moreover, when explain how to transit from the initscript, some referrals on how to move the old custom hooks in /etc/rc.d/functions.d to be executed by systemd, should be made.
-- DarioP (talk) 12:42, 18 November 2012 (UTC)

I think it needs to be expanded indeed. As a newbie, it is easy to grasp the concept of "put your code in rc.local", and it's not clear how to transition. Specific questions, as also mentioned by DarioP: In what directory should I place my service definition? On the examples page, there are some files named with an at-sign (@), what difference does that make? It would be very helpful to have a complete example for running a single command at boot (my example: echo noop > /sys/block/sdb/queue/scheduler).
-- Fa2k (talk) 3 February 2013

Systemd defaults / to rshared, gotcha

Still reading up on this, so I'm not 100% solid but I discovered during the systemd transition that it defaults the / mount to rshared (see Shared subtree for definitions). Excerpted from core/mount-setup.c in systemd github:
/* Mark the root directory as shared in regards to mount
 * propagation. The kernel defaults to "private", but we think
 * it makes more sense to have a default of "shared" so that
 * nspawn and the container tools work out of the box. If
 * specific setups need other settings they can reset the
 * propagation mode to private if needed. */
if (detect_container(NULL) <= 0)
        if (mount(NULL, "/", NULL, MS_REC|MS_SHARED, NULL) < 0)
                log_warning("Failed to set up the root directory for shared mount propagation: %m");

This means that all bind mounts made through fstab will default to shared behavior, not private. For those users who depend on non-recursive bind mounts, this can be a very big gotcha (as the mount propagation effectively nullifies the non-recursion). I think it should be at least noted under Filesystem Mounts, since fstab bind entries definitely may not preserve behavior across the systemd transition and there are definitely some systems that would fail to start up/operate properly due to this, perhaps even silently.

As a side note, for nested bind mounts this also results in multiplicative bloat of the mount table, depending on what kind of nesting structure is used (it's actually relatively easy to construct a nesting sequence that makes 2^n mounts out of n mount calls).

Still looking into good (and easy) configuration solutions.

Compgamer89 (talk) 07:16, 4 December 2012 (UTC)

You may find this commit useful. --David Strauss (talk) 22:58, 13 December 2012 (UTC)

Disputed groups section

This template/warning should be removed. If there is a genuine dispute, then there should be accompanying material, ie., arguments and evidence, on this page.

Jasonwryan (talk) 23:02, 18 March 2013 (UTC)

Done. Earnest (talk) 22:20, 23 March 2013 (UTC)

systemd no longer supports initscripts

http://cgit.freedesktop.org/systemd/systemd/commit/?id=53d05b44f17db67d644069600e4b5bbca88d21e7

-- D garbage

Please add your signature next time by typing four tildes (~~~~)
Anyway, I think it may be worth considering to remove all initscripts related sections. Initscripts has been unsupported for almost half a year now, whoever still hasn't switched is screwed anyway. About time this article gets a little shorter. Other opinions?
65kid (talk) 10:16, 24 March 2013 (UTC)
Considering that, on multiple occasions, I've seen people come into the #archlinux channel on IRC and state that they haven't updated their systems for almost a year, I think we should keep this info in the wiki for a couple more months at least.
-- Jstjohn (talk) 19:53, 24 March 2013 (UTC)

Duplication of content in Native configuration section

I don't remember if this topic has already been discussed here, but it seems to me that systemd#Native configuration is duplicating information that IMO better belongs to other articles:

I would suggest removing all these sections or replacing them with links to the reported articles, possibly merging any information that those articles are missing.

-- Kynikos (talk) 16:16, 13 April 2013 (UTC)

+1 for move them out. They are in a central page because at that time, initscripts is the only init supported. Now when a user want to know how to set up LVM, LVM is the natual target. Very few of them will ever goto Systemd and go to LVM section. -- Fengchao (talk) 12:52, 14 April 2013 (UTC)
Thanks, started with systemd#Hostname, any help will be appreciated of course, I think there are also other sections that can be moved out. -- Kynikos (talk) 11:15, 15 April 2013 (UTC)