LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 08-24-2016, 09:52 PM   #1
wh33t
Member
 
Registered: Oct 2003
Location: Canada
Posts: 922

Rep: Reputation: 61
Question Finally managed to get a static ip set and dns working properly, got a question though.


I followed this guide: https://www.howtoforge.com/linux-bas...c-ip-on-ubuntu and managed to get it work however it required a reboot for the changes to take effect.

The bottom part of the guide which has this command:

Code:
systemctl restart ifup@eth0
is supposed to bring the network back up right? I'm curious why the guide didn't suggest to use

Code:
sudo service networking restart
and I'm also curious why when I ran systemctl restart ifup@eth0 some red text appeared and asked me to authenticate.

Output:
Code:
==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units ===
Authentication is required to restart 'ifup@eth0.service'.
Authenticating as: wh33t,,, (wh33t)
Password:
I didn't just give out my password to my user account to some website did I?
 
Old 08-25-2016, 05:51 AM   #2
HMW
Member
 
Registered: Aug 2013
Location: Sweden
Distribution: Debian, Arch, Red Hat, CentOS
Posts: 773
Blog Entries: 3

Rep: Reputation: 369Reputation: 369Reputation: 369Reputation: 369
Hi!

Quote:
Originally Posted by wh33t View Post
and I'm also curious why when I ran systemctl restart ifup@eth0 some red text appeared and asked me to authenticate.
Because you need root (sudo) privileges to do that.


Quote:
Originally Posted by wh33t View Post
I didn't just give out my password to my user account to some website did I?
No, you did not.

Best regards,
HMW
 
1 members found this post helpful.
Old 08-25-2016, 06:07 AM   #3
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,574
Blog Entries: 19

Rep: Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453
What you mistook for a website is actually a program name used by dbus. systemd/systemctl uses dbus to send instructions to programs. Every program has a "well-known-name" that is registered with dbus, and these use what is called reverse dns notation. The org suffix comes first, then the organisation, then the name -- the reverse of a normal url.
 
2 members found this post helpful.
Old 08-25-2016, 03:42 PM   #4
wh33t
Member
 
Registered: Oct 2003
Location: Canada
Posts: 922

Original Poster
Rep: Reputation: 61
Quote:
Originally Posted by hazel View Post
What you mistook for a website is actually a program name used by dbus. systemd/systemctl uses dbus to send instructions to programs. Every program has a "well-known-name" that is registered with dbus, and these use what is called reverse dns notation. The org suffix comes first, then the organisation, then the name -- the reverse of a normal url.
Awesome. Thank you for the information.

Would you happen to know if
Code:
sudo service networking restart
is obsolete now? It doesn't appear as thought it works as I expect it to anymore.
 
Old 08-25-2016, 04:25 PM   #5
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,704

Rep: Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896
Yes, it depends on the distribution/version's init process. If you reread the link you posted you will see that for Ubuntu versions newer then 14 (>14) the command is systemctl which is used by systemd. While older Ubuntu versions used either upstart or sysv depending on how far you want to go back which use the old service command.

Last edited by michaelk; 08-25-2016 at 04:27 PM.
 
1 members found this post helpful.
Old 08-25-2016, 04:37 PM   #6
wh33t
Member
 
Registered: Oct 2003
Location: Canada
Posts: 922

Original Poster
Rep: Reputation: 61
Quote:
Originally Posted by michaelk View Post
Yes, it depends on the distribution/version's init process. If you reread the link you posted you will see that for Ubuntu versions newer then 14 (>14) the command is systemctl which is used by systemd. While older Ubuntu versions used either upstart or sysv depending on how far you want to go back which use the old service command.
I guess I'm just confused as to why the system still accepts an older-not-right way of doing things. Why isn't that removed from the system if it's no longer the right way to restart the networking services?
 
Old 08-25-2016, 04:42 PM   #7
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,704

Rep: Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896
I believe it is for backwards compatibility if you still have services that use old init scripts. Check your /etc/rcx.d directories. The networking services are systemd.
 
1 members found this post helpful.
Old 08-26-2016, 12:45 AM   #8
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,574
Blog Entries: 19

Rep: Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453
I believe that by default, systemd creates temporary service files for init scripts that it finds in rc.S and rc.2. You should be able to find them in the /run tree somewhere.
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I set up Slackware 9.1 to use DHCP with a static DNS? h00chman Linux - Newbie 2 12-18-2012 09:30 AM
Set static dns/nameserver in Gentoo fakie_flip Linux - Networking 1 07-11-2012 08:03 PM
Linux Static IP Configured | Not working properly AsadMoeen Linux - Networking 3 10-30-2010 04:38 AM
set static dns server in debian jsmarshall85 Linux - Networking 5 09-07-2009 06:44 AM
How to set a static IP and DNS server phil1076 Linux - Networking 1 08-19-2003 06:20 PM

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

All times are GMT -5. The time now is 10:08 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