Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

It says in the fedora documentation that you can append this line to the boot options to change the *.target that loads temporarily at boot.

systemd.unit=rescue.target

Nothing seems to happen it still boots into a graphical environment, is there any reason this might be happening? I don't want to find a substitute for this command, I would really like to know why this one is not working.

Thanks in advance.

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

@Rubixibuc, fedora 15 onwards, the Sys V style of init startup in Linux is changed/evolved into using systemd. Systemd is a new framework, its a drop in replacement of init and init related configurations like inittab for runlevel configurations are not used, instead runlevels are changed to the terminology of targets. systemd provides aggressive parallelization capabilities, uses socket and D-Bus activation for starting services, offers on-demand starting of daemons, keeps track of processes using Linux cgroups, supports snapshotting and restoring of the system state, maintains mount and automount points and implements an elaborate transactional dependency-based service control logic. It is intended to provide a better framework for expressing services' dependencies, allow more work to be done in parallel at system startup, and to reduce shell overhead.

As far as your question goes:

Q: How do I change the default runlevel to boot into?

A: The symlink /etc/systemd/system/default.target controls where we boot into by default. Link it to the target unit of your choice. For example, like this:

# ln -sf /lib/systemd/system/multi-user.target /etc/systemd/system/default.target or

# ln -sf /lib/systemd/system/graphical.target /etc/systemd/system/default.target

Q: How do I figure out the current runlevel?

A: Note that there might be more than one target active at the same time. So the question regarding the runlevel might not always make sense. Here's how you would figure out all targets that are currently active:

$ systemctl list-units --type=target If you are just interested in a single number, you can use the venerable runlevel command, but again, its output might be misleading.

Get a quick start for yourself here at

http://0pointer.de/blog/projects/systemd-for-admins-2.html

http://www.freedesktop.org/wiki/Software/systemd/TipsAndTricks

http://www.freedesktop.org/wiki/Software/systemd/FrequentlyAskedQuestions

share|improve this answer
    
I meant how do I change the run level temporarily at boot like we used to be able to do with other methods. How do we do it with systemd –  rubixibuc Dec 9 '11 at 4:29
    
First look at what all targets can you boot into under /lib/systemd/system/ and append that target to kernel line at grub menu. It should be systemd.unit= as you correctly noted. –  Nikhil Mulley Dec 9 '11 at 4:40
    
try emergency.target as the argument. –  Nikhil Mulley Dec 9 '11 at 4:42
1  
I realized what I was doing wrong X-(, I was adding it on it's own line after the initial ram disk was set up, adding it directly on the kernel line, fixed it. Thanks :-) –  rubixibuc Dec 9 '11 at 4:45
    
You are welcome, @rubixibuc :-) –  Nikhil Mulley Dec 9 '11 at 4:55
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.