You are not logged in.
Pages: 1
When I wanna turn off the system normally it goes out of X, and when I wanna turn it off using command line, I see this error:
[mghaffari@archlinux ~]$ sudo shutdown -h now
shutdown: warning: cannot open /var/run/shutdown.pid
shutdown: /dev/initctl: Permission denied
init: must be superuser.
[mghaffari@archlinux ~]$ Offline
Arch this time, or still Chakra?
Offline
I think this time he managed to change all instances of chakra-pc ![]()
Shame you got caught lying/deceiving before, mghaffari - it may stop you getting further help round here.
Offline
There isn't much help to get anyway. mghaffari, if this is indeed Chakra-related, then you need to take a close look at the Chakra FAQ, which explicitly states that Arch and Chakra are not compatible. If you are using Arch, then by all means, ask away; if not, you're just wasting everyone's time, including your own.
Last edited by ANOKNUSA (2012-08-18 23:14:18)
Offline
I'll bite.
What is the output of groups when logged in as mghaffari?
BTW: I am going to take you at your word that this is an Archlinux system. If I find you are not being truthful, I will permanently ban your account and IP address. که بفهمم؟
Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way
Offline
I just use:
sudo poweroffNever had a problem with that on any distro.
Offline
My guess is your user is not in the wheel group or you haven't properly configured the sudoers file.
Too bad you got caught lying... Good luck.
"mghaffari@archlinux" seems a little too desperate to try to show you are running Arch. ![]()
Last edited by el_psycho (2012-08-19 03:59:07)
Offline
Well, I wanna mention something about this matter. These problems (actually most of them) are not my own problems. I have many friends (geeks, of course) using Arch and other GNU/Linux operation systems like Chakra and Ubuntu. And there's a perfect forum for Iranian users of Ubuntu, of course, but there's not something useful for either Arch or Chakra users. They ask their question in Persian, and when they can't find a solution I ask them in English, trying to find an answer for them. Plus, the Chakra forum users are not so active, and that's another reason to do something like that. I know the rules of this forum, of course, and I don't have any problem with them. All I want is helping my friends; nothing much.
+
This question is an Arch one indeed.
Last edited by mghaffari (2012-08-19 05:04:58)
Offline
Well, I wanna mention something about this matter. These problems (actually most of them) are not my own problems. I have many friends (geeks, of course) using Arch and other GNU/Linux operation systems like Chakra and Ubuntu. And there's a perfect forum for Iranian users of Ubuntu, of course, but there's not something useful for either Arch or Chakra users. They ask their question in Persian, and when they can't find a solution I ask them in English, trying to find an answer for them. Plus, the Chakra forum users are not so active, and that's another reason to do something like that. I know the rules of this forum, of course, and I don't have any problem with them. All I want is helping my friends; nothing much.
+
This question is an Arch one indeed.
But... its your username in the output you gave us. umm... just be honest from the start.
Anyways try looking into the suggestions you've already gotten.
Offline
Plus, the Chakra forum users are not so active, and that's another reason to do something like that. I know the rules of this forum, of course, and I don't have any problem with them. All I want is helping my friends; nothing much.
If "something like that" means pretending it is Arch rather than Chakra then in what sense do you not "have any problem with" the rules of the forum? Obviously whatever you mean by this, it doesn't mean that you respect those rules.
And while helping your friends may be laudable (if that's what you are doing), it doesn't give you a free licence to break those rules. Apart from anything else, it isn't even a good way to help your friends. Any advice you do get may be inappropriate to their system and, as you've seen, being caught in a deception makes people reluctant to spend time offering you solutions. The help you are able to give your friends from these forums is only as good as _your_ credibility here. So even if you are inclined to think of keeping or breaking the rules in purely instrumental terms, you still have reason to respect them.
Last edited by cfr (2012-08-19 14:17:03)
CLI Paste | How To Ask Questions
Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L
Offline
But, back on topic, can you verify that your user is a member of the 'wheel' group. If not, add them, log out, then log back in. Then try the sudo shutdown
If that does not work, please post your /etc/sudoers file.
Also, ensure that sudo permissions are set as such
ewaller@odin:/etc 1013 %ls -l $(which sudo)
---s--x--x 2 root root 125515 Aug 14 23:23 /usr/bin/sudo
ewaller@odin:/etc 1014 %Finally, what is the output of grep sudo /var/log/auth.log ??
Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way
Offline
@ewaller,
You have odin as your hostname? That's fabulous!
[Sorry, I know this is even further off topic.]
@mghaffari,
If your friend needs to edit the sudoers file, don't forget to remind him/her to use visudo rather than a regular editor.
CLI Paste | How To Ask Questions
Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L
Offline
@ewaller,
You have odin as your hostname? That's fabulous!
![]()
Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way
Offline
[mghaffari@archlinux ~]$ sudo cat /etc/sudoers
Password:
## sudoers file.
##
## This file MUST be edited with the 'visudo' command as root.
## Failure to use 'visudo' may result in syntax or file permission errors
## that prevent sudo from running.
##
## See the sudoers man page for the details on how to write a sudoers file.
##
##
## Host alias specification
##
## Groups of machines. These may include host names (optionally with wildcards),
## IP addresses, network numbers or netgroups.
# Host_Alias WEBSERVERS = www1, www2, www3
##
## User alias specification
##
## Groups of users. These may consist of user names, uids, Unix groups,
## or netgroups.
# User_Alias ADMINS = millert, dowdy, mikef
##
## Cmnd alias specification
##
## Groups of commands. Often used to group related commands together.
# Cmnd_Alias PROCESSES = /usr/bin/nice, /bin/kill, /usr/bin/renice, \
# /usr/bin/pkill, /usr/bin/top
##
## Defaults specification
##
## You may wish to keep some of the following environment variables
## when running commands via sudo.
##
## Locale settings
# Defaults env_keep += "LANG LANGUAGE LINGUAS LC_* _XKB_CHARSET"
##
## Run X applications through sudo; HOME is used to find the
## .Xauthority file. Note that other programs use HOME to find
## configuration files and this may lead to privilege escalation!
# Defaults env_keep += "HOME"
##
## X11 resource path settings
# Defaults env_keep += "XAPPLRESDIR XFILESEARCHPATH XUSERFILESEARCHPATH"
##
## Desktop path settings
# Defaults env_keep += "QTDIR KDEDIR"
##
## Allow sudo-run commands to inherit the callers' ConsoleKit session
# Defaults env_keep += "XDG_SESSION_COOKIE"
##
## Uncomment to enable special input methods. Care should be taken as
## this may allow users to subvert the command being run via sudo.
# Defaults env_keep += "XMODIFIERS GTK_IM_MODULE QT_IM_MODULE QT_IM_SWITCHER"
##
## Uncomment to enable logging of a command's output, except for
## sudoreplay and reboot. Use sudoreplay to play back logged sessions.
# Defaults log_output
# Defaults!/usr/bin/sudoreplay !log_output
# Defaults!/usr/local/bin/sudoreplay !log_output
# Defaults!/sbin/reboot !log_output
##
## Runas alias specification
##
##
## User privilege specification
##
root ALL=(ALL) ALL
mghaffari ALL=(ALL) ALL
## Uncomment to allow members of group wheel to execute any command
# %wheel ALL=(ALL) ALL
## Same thing without a password
# %wheel ALL=(ALL) NOPASSWD: ALL
## Uncomment to allow members of group sudo to execute any command
# %sudo ALL=(ALL) ALL
## Uncomment to allow any user to run sudo if they know the password
## of the user they are running the command as (root by default).
# Defaults targetpw # Ask for the password of the target user
# ALL ALL=(ALL) ALL # WARNING: only use this together with 'Defaults targetpw'
## Read drop-in files from /etc/sudoers.d
## (the '#' here does not indicate a comment)
#includedir /etc/sudoers.d
mghaffari ALL=NOPASSWD: /sbin/shutdown
[mghaffari@archlinux ~]$ ls -l $(which sudo)
---s--x--x 1 root root 123995 May 18 17:30 /usr/bin/sudo
[mghaffari@archlinux ~]$ grep sudo /var/log/auth.log
Aug 20 12:01:37 archlinux sudo: mghaffari : TTY=pts/1 ; PWD=/home/mghaffari ; USER=root ; COMMAND=/bin/cat
Aug 20 12:01:37 archlinux sudo: pam_unix(sudo:session): session opened for user root by (uid=0)
Aug 20 12:01:40 archlinux sudo: pam_unix(sudo:session): session closed for user root
Aug 20 12:01:44 archlinux sudo: mghaffari : TTY=pts/1 ; PWD=/home/mghaffari ; USER=root ; COMMAND=/bin/ls
Aug 20 12:01:44 archlinux sudo: pam_unix(sudo:session): session opened for user root by (uid=0)
Aug 20 12:01:44 archlinux sudo: pam_unix(sudo:session): session closed for user root
Aug 20 12:02:10 archlinux sudo: mghaffari : TTY=pts/1 ; PWD=/home/mghaffari ; USER=root ; COMMAND=/bin/cat /etc/sudoers
Aug 20 12:02:10 archlinux sudo: pam_unix(sudo:session): session opened for user root by (uid=0)
Aug 20 12:02:10 archlinux sudo: pam_unix(sudo:session): session closed for user root+
[mghaffari@archlinux ~]$ uname -a
Linux archlinux 3.3.6-1-ARCH #1 SMP PREEMPT Sun May 13 09:59:18 UTC 2012 i686 GNU/LinuxLast edited by mghaffari (2012-08-20 15:32:42)
Offline
Last lines of your sudoers file:
## (the '#' here does not indicate a comment)
#includedir /etc/sudoers.d
mghaffari ALL=NOPASSWD: /sbin/shutdownI think you should move the last line before the other lines of this snippet.
Offline
I think you need:
mghaffari ALL=(ALL) NOPASSWD: /sbin/shutdownThe (ALL) means that mghaffari can run shutdown as any user. Without the (ALL) he is probably only allowed to run it as mghaffari, i.e. without using sudo.
Offline
I think you need:
mghaffari ALL=(ALL) NOPASSWD: /sbin/shutdownThe (ALL) means that mghaffari can run shutdown as any user. Without the (ALL) he is probably only allowed to run it as mghaffari, i.e. without using sudo.
I thought this looked wrong too but the man page suggests it should work, if I'm reading it right:
ray rushmore = NOPASSWD: /bin/kill, /bin/ls, /usr/bin/lprm
would allow the user ray to run /bin/kill, /bin/ls, and /usr/bin/lprm as root on the machine rushmore without
authenticating himself. CLI Paste | How To Ask Questions
Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L
Offline
Pages: 1