Difference between revisions of "Talk:Systemd"

From ArchWiki
Jump to: navigation, search
m (Hibernation with systemd)
(Should we add a note about CUPS under 'Transitioning from initscripts to systemd'?: Close old topic.)
(47 intermediate revisions by 18 users not shown)
Line 1: Line 1:
== <s> Lack of internet connection using static ip address without netcfg or NetworkManager</s> ==
+
== Should the section "writing a custom .service" be expanded? ==
  
See [[Systemd#A_pure_systemd_installation]] it instructs to remove the initscripts package.  When doing so take care not to use the -s option  of pacman with -R as it removes the iproute2 package also unless you have another package with iproute2 as a dependency.
+
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.
  
Safe:
+
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>
pacman -R initscripts
+
-- [[User:DarioP|DarioP]] ([[User talk:DarioP|talk]]) 12:42, 18 November 2012 (UTC)
 
+
pacman -Rn initscripts
+
  
 +
: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:Fa2k|Fa2k]] ([[User talk:Fa2k|talk]]) 3 February 2013
  
Not safe when iproute2 will also be removed:
+
== <s> Display manager fails to load with fast SSD </s> ==
pacman -Rs initscripts 
+
 
+
pacman -Rns initscripts
+
 
+
-- [[User:imatechguy|imatechguy]] ([[User talk:imatechguy|talk]]) 00:28, 11 Oct 2012 (UTC)
+
* It is fixed. iproute2 is in {{grp|base}} group now. Close.
+
:-- [[User:Fengchao|Fengchao]] ([[User talk:Fengchao|talk]]) 02:19, 18 October 2012 (UTC)
+
:* Only the {{Pkg|iproute2}} build in [testing] is in the base group. It's been in [testing] for nearly a week, so hopefully it'll be released soon.
+
::-- [[User:Jstjohn|Jstjohn]] ([[User talk:Jstjohn|talk]]) 16:19, 21 October 2012 (UTC)
+
 
+
== Display manager fails to load with fast SSD ==
+
  
 
I was having a problem with my display manager (LXDM) not loading on my laptop, which has a Sandisk Extreme SSD.
 
I was having a problem with my display manager (LXDM) not loading on my laptop, which has a Sandisk Extreme SSD.
Line 28: Line 17:
  
 
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)
 
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)
* 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.
+
: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)
 
:-- [[User:Falconindy|Falconindy]] ([[User talk:Falconindy|talk]]) 21:34, 2 September 2012 (UTC)
  
== Hibernation with systemd ==
+
== <s> Should we add a note about CUPS under 'Transitioning from initscripts to systemd'? </s> ==
 +
Are there any more sockets that change?
 +
 
 +
Copied from the CUPS wiki:
 +
 
 +
...
 +
 
 +
Systemd uses a different CUPS socket file located at:
  
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‎
+
/usr/lib/systemd/system/cups.socket
  
* 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).
+
The default CUPS socket file is located at:
:-- [[User:Nierro|Nierro]] ([[User talk:Nierro|talk]]) 13:54, 24 October 2012
+
  
* 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)
+
/var/run/cups/cups.sock
  
* 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. [[User:Nierro|Nierro]] ([[User talk:Nierro|talk]]) 11:24, 26 October 2012
+
Edit {{ic|/etc/cups/cupsd.conf}} and {{ic|/etc/cups/client.conf}} as root to use the systemd socket instead of the default. Make sure to restart CUPS when you are done:
  
== Removing rc.local ==
+
# systemctl restart cups
  
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:
+
...
 +
<br>
 +
-- [[User:JKAbrams|JKAbrams]] 5 November 2012
 +
:This sounds more like a {{pkg|cups}} packaging bug that should just be fixed.
 +
:-- [[User:Jstjohn|Jstjohn]] ([[User talk:Jstjohn|talk]]) 01:11, 8 November 2012 (UTC)
 +
::It sounds like someone who doesn't have a clue about systemd. That cups.socket file is a systemd unit file of type socket, which contains the location of the socket file for CUPS (and that is still /var/run/cups/cups.sock).
 +
::[[User:Raynman|Raynman]] ([[User talk:Raynman|talk]]) 22:49, 9 November 2012 (UTC)
 +
::: Close. [[CUPS]] page already fixed this issue. -- [[User:Fengchao|Fengchao]] ([[User talk:Fengchao|talk]]) 08:19, 18 February 2013 (UTC)
  
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
+
== Systemd defaults / to rshared, gotcha  ==
  
== Replacing ConsoleKit with systemd-logind -> networkmanager ==
+
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.
  
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.
+
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
Am i missing anything?<br> -- [[User:Nierro|Nierro]] ([[User talk:Nierro|talk]]) 09:31, 15 October 2012
+
is used (it's actually relatively easy to construct a nesting sequence that makes 2^n mounts out of n mount calls).
  
* 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
+
Still looking into good (and easy) configuration solutions.
:[[User:65kid|65kid]] ([[User talk:65kid|talk]]) 20:00, 15 October 2012 (UTC)
+
  
:*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:Compgamer89|Compgamer89]] ([[User talk:Compgamer89|talk]]) 07:16, 4 December 2012 (UTC)
::-- [[User:Nierro|Nierro]] ([[User talk:Nierro|talk]]) 16:35, 15 October 2012
+
  
== <s>Removing systemd-sysvcompat?</s> ==
+
: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)
  
So I was thinking: lets go all the way and remove {{Pkg|systemd-sysvcompat}}. After some scary moments I found out {{ic|1=init=/usr/lib/systemd/systemd}} has to be enabled since otherwise there is nothing to boot into. I also noticed this removes the reboot and poweroff commands ( {{ic|systemctl {reboot,shutdown<nowiki>}</nowiki>}} replace these).
+
== <s>"Error: No space left on device" when trying to start/restart a service"</s> ==
  
Now, is this the recommended way to go in the future, or should everyone keep systemd-sysvcompat installed?<br>-- [[User:Lonaowna|Lonaowna]] ([[User talk:Lonaowna|talk]]) 23:56, 20 October 2012 (UTC)
+
This troubleshooting section was removed because it was "totally irrelevant. Why is this irrelevant?<br>
 +
--[[User:Skiguy0123|Skiguy0123]] ([[User talk:Skiguy0123|talk]]) 00:35, 11 February 2013 (UTC)
  
*Based on the files {{Pkg|systemd-sysvcompat}} provides (click "View the file list for systemd-sysvcompat"), I think most people will want to keep this package installed indefinitely.
+
:Because that error is caused by excessive inode usage, which has nothing to do with systemd.
:-- [[User:Jstjohn|Jstjohn]] ([[User talk:Jstjohn|talk]]) 21:39, 21 October 2012 (UTC)
+
:-- [[User:Jstjohn|Jstjohn]] ([[User talk:Jstjohn|talk]]) 23:24, 11 February 2013 (UTC)
  
:*I'm considering this closed.
+
::Closing.
::-- [[User:Jstjohn|Jstjohn]] ([[User talk:Jstjohn|talk]]) 15:31, 24 October 2012 (UTC)
+
::-- [[User:Jstjohn|Jstjohn]] ([[User talk:Jstjohn|talk]]) 22:08, 15 February 2013 (UTC)

Revision as of 08:19, 18 February 2013

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

Display manager fails to load with fast SSD

I was having a problem with my display manager (LXDM) not loading on my laptop, which has a Sandisk Extreme SSD. 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.

Just a tip for SSD users, not sure if it should be added to the page or not.
--Steev (talk) 16:59, 2 September 2012 (UTC)

This is a general problem that needs to be solved in the display manager. GDM already implements the bits for the CanGraphical flag.
-- Falconindy (talk) 21:34, 2 September 2012 (UTC)

Should we add a note about CUPS under 'Transitioning from initscripts to systemd'?

Are there any more sockets that change?

Copied from the CUPS wiki:

...

Systemd uses a different CUPS socket file located at:

/usr/lib/systemd/system/cups.socket

The default CUPS socket file is located at:

/var/run/cups/cups.sock

Edit /etc/cups/cupsd.conf and /etc/cups/client.conf as root to use the systemd socket instead of the default. Make sure to restart CUPS when you are done:

# systemctl restart cups

...
-- JKAbrams 5 November 2012

This sounds more like a cups packaging bug that should just be fixed.
-- Jstjohn (talk) 01:11, 8 November 2012 (UTC)
It sounds like someone who doesn't have a clue about systemd. That cups.socket file is a systemd unit file of type socket, which contains the location of the socket file for CUPS (and that is still /var/run/cups/cups.sock).
Raynman (talk) 22:49, 9 November 2012 (UTC)
Close. CUPS page already fixed this issue. -- Fengchao (talk) 08:19, 18 February 2013 (UTC)

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)

"Error: No space left on device" when trying to start/restart a service"

This troubleshooting section was removed because it was "totally irrelevant. Why is this irrelevant?
--Skiguy0123 (talk) 00:35, 11 February 2013 (UTC)

Because that error is caused by excessive inode usage, which has nothing to do with systemd.
-- Jstjohn (talk) 23:24, 11 February 2013 (UTC)
Closing.
-- Jstjohn (talk) 22:08, 15 February 2013 (UTC)