LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > CentOS
User Name
Password
CentOS This forum is for the discussion of CentOS Linux. Note: This forum does not have any official participation.

Notices


Reply
  Search this Thread
Old 06-09-2017, 09:53 AM   #1
vincix
Senior Member
 
Registered: Feb 2011
Distribution: Ubuntu, Centos
Posts: 1,240

Rep: Reputation: 103Reputation: 103
default.target in Centos 7.3.1611 is graphical instead of multiuser


I'm currently in /usr/lib/systemd/system.
If I do a cat default.target I get:
Code:
[Unit]
Description=Graphical Interface
Documentation=man:systemd.special(7)
Requires=multi-user.target
Wants=display-manager.service
Conflicts=rescue.service rescue.target
After=multi-user.target rescue.service rescue.target display-manager.service
AllowIsolate=yes
However, if I run systemctl get-default I get "multi-user.target". Any idea why this is happening?

In RHCA/RCHE 7 Certificate Guide there's an example of how multi-user.taget looks like.
And there are two rows that are missing from my OS:
[Install]
Alias=default.target

How does this all work?
 
Old 06-09-2017, 12:52 PM   #2
vincix
Senior Member
 
Registered: Feb 2011
Distribution: Ubuntu, Centos
Posts: 1,240

Original Poster
Rep: Reputation: 103Reputation: 103
Ok, the explanation consists in the fact that actual default.target resides in /etc/systemd/system, not in /usr/lib/systemd/system, where I'm guessing all units can be found.

When I enable a service, I really find the output rather misleading, but I guess that's just me (maybe because I'm not a native speaker, I don't know):
Code:
systemctl enable iptables
Created symlink from /etc/systemd/system/basic.target.wants/iptables.service to /usr/lib/systemd/system/iptables.service.
And I thought the second file (in /usr/lib) was a symlink for the first file (in /etc). But it's the other way around:
Code:
ll -d /etc/systemd/system/basic.target.wants/iptables.service
lrwxrwxrwx 1 root root 40 Jun  9 20:48 /etc/systemd/system/basic.target.wants/iptables.service -> /usr/lib/systemd/system/iptables.service
 
Old 06-09-2017, 01:00 PM   #3
dejank
Member
 
Registered: May 2016
Location: Belgrade, Serbia
Distribution: Debian
Posts: 229

Rep: Reputation: Disabled
Systemd by default, on most/all distros that install graphical environment has default target under /lib/systemd/system/default.target (or in some distros under usr/lib/systemd/...) that is symbolic link to /lib/systemd/system/graphical.target. However, real default for every system is determined by symbolic link of /etc/systemd/system/default.target(if it exists, otherwise original one under /lib/systemd/... is used), where customization on per system basis is done. That link points to the /lib/systemd/system/multi-user.target in your case, that is why you get it with systemctl get-default.

Quote:
And I thought the second file (in /usr/lib) was a symlink for the first file (in /etc). But it's the other way around
Yes, it is as it should be. Those go from /etc/... to /lib/...(/usr/lib/...). That "from to" means "this points to that".

Last edited by dejank; 06-09-2017 at 01:05 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] How do I copy files from CentOS 7.3.1611 (Core) to a Windows NFS Share SecGuy Linux - Newbie 6 05-24-2017 06:47 PM
LXer: CentOS 7.3 (1611) Linux Distro Officially Released for ARM64/AArch64 Machines LXer Syndicated Linux News 0 01-05-2017 12:43 AM
[SOLVED] Unable to install New CentOS 7.3-1611 codyngr Linux - Newbie 5 12-14-2016 05:03 AM
LXer: CentOS Linux 7 (1611) Released, It's Derived from Red Hat Enterprise Linux 7.3 LXer Syndicated Linux News 0 12-13-2016 12:03 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > CentOS

All times are GMT -5. The time now is 06:39 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration