AnsweredAssumed Answered

must be a superuser. unable to poweroff and shutdown as root

Question asked by Vijayaragavan Srinivasan on Oct 7, 2016
Latest reply on Nov 27, 2017 by Alex Held

Hi All,
am able to download the content from git now.
i built core-image-base and set root password and mounted over NFS and things are working as expected.
but when i execute the command poweroff,reboot,shutdown is asking for super user,
below is the message from terminal
root@hello:~# poweroff
poweroff: must be superuser.
root@hello:~# reboot
reboot: must be superuser.
root@hello:~# shutdown -r now
shutdown: warning: cannot open /var/run/shutdown.pid
shutdown: /dev/initctl: Permission denied
init: must be superuser.
root@hello:~# cat /etc/passwd
root:x:0:0:root:/home/root:/bin/sh
daemon:x:1:1:daemon:/usr/sbin:/bin/sh
bin:x:2:2:bin:/bin:/bin/sh
sys:x:3:3:sys:/dev:/bin/sh
sync:x:4:65534:sync:/bin:/bin/sync
games:x:5:60:games:/usr/games:/bin/sh
man:x:6:12:man:/var/cache/man:/bin/sh
lp:x:7:7:lp:/var/spool/lpd:/bin/sh
mail:x:8:8:mail:/var/mail:/bin/sh
news:x:9:9:news:/var/spool/news:/bin/sh
uucp:x:10:10:uucp:/var/spool/uucp:/bin/sh
proxy:x:13:13:proxy:/bin:/bin/sh
www-data:x:33:33:www-data:/var/www:/bin/sh
backup:x:34:34:backup:/var/backups:/bin/sh
list:x:38:38:Mailing List Manager:/var/list:/bin/sh
irc:x:39:39:ircd:/var/run/ircd:/bin/sh
gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/bin/sh
nobody:x:65534:65534:nobody:/nonexistent:/bin/sh
rpc:x:999:999::/:/bin/false
avahi:x:998:998::/var/run/avahi-daemon:/bin/false
sshd:x:997:997::/var/run/sshd:/bin/false
messagebus:x:996:995::/var/lib/dbus:/bin/false
rpcuser:x:995:994::/var/lib/nfs:/bin/false
pulse:x:994:1001::/var/run/pulse:/bin/false
root@hello:~# cat /etc/shadow
root:$6$kTvdT/eRFpQ/ZDeA$tBghQG.52TsnHOxaanBo.MtKbKowBwaZtGKBdNPoW.w66xexzRcPbtHFyDO.yP04L.tnsMkcGgGSmpx3rAvMC/:17081:0:99999:7:::
daemon:*:17081:0:99999:7:::
bin:*:17081:0:99999:7:::
sys:*:17081:0:99999:7:::
sync:*:17081:0:99999:7:::
games:*:17081:0:99999:7:::
man:*:17081:0:99999:7:::
lp:*:17081:0:99999:7:::
mail:*:17081:0:99999:7:::
news:*:17081:0:99999:7:::
uucp:*:17081:0:99999:7:::
proxy:*:17081:0:99999:7:::
www-data:*:17081:0:99999:7:::
backup:*:17081:0:99999:7:::
list:*:17081:0:99999:7:::
irc:*:17081:0:99999:7:::
gnats:*:17081:0:99999:7:::
nobody:*:17081:0:99999:7:::
rpc:!:17081::::::
avahi:!:17081::::::
sshd:!:17081::::::
messagebus:!:17081::::::
rpcuser:!:17081::::::
pulse:!:17081::::::
root@hello:~# cat /etc/sudoers
## 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
# Cmnd_Alias REBOOT = /sbin/halt, /sbin/reboot, /sbin/poweroff
##
## 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 use a hard-coded PATH instead of the user's to find commands
# Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
##
## Uncomment to send mail if the user does not enter the correct password.
# Defaults mail_badpass
##
## 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!REBOOT !log_output
##
## Runas alias specification
##
##
## User privilege specification
##
root 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

i tried all images like core-image-base,fsl-gui-image,etc...
and this is the content of local.conf
MACHINE ??= 'imx6ulevk'
DISTRO ?= 'fsl-imx-x11'
PACKAGE_CLASSES ?= "package_rpm"
#EXTRA_IMAGE_FEATURES = "debug-tweaks"
EXTRA_IMAGE_FEATURES = "ssh-server-openssh"
INHERIT += "extrausers"
EXTRA_USERS_PARAMS = "usermod -P hello root;"
USER_CLASSES ?= "buildstats image-mklibs"
PATCHRESOLVE = "noop"
BB_DISKMON_DIRS = "\
STOPTASKS,${TMPDIR},1G,100K \
STOPTASKS,${DL_DIR},1G,100K \
STOPTASKS,${SSTATE_DIR},1G,100K \
STOPTASKS,/tmp,100M,100K \
ABORT,${TMPDIR},100M,1K \
ABORT,${DL_DIR},100M,1K \
ABORT,${SSTATE_DIR},100M,1K \
ABORT,/tmp,10M,1K"
#PACKAGECONFIG_append_pn-qemu-native = " sdl"
#PACKAGECONFIG_append_pn-nativesdk-qemu = " sdl"
BUILD_LDFLAGS_prepend_pn-qemu-native = "-Wl,-rpath-link,/lib/x86_64-linux-gnu "
ASSUME_PROVIDED += "libsdl-native"
CONF_VERSION = "1"
DL_DIR ?= "${BSPDIR}/downloads/"
ACCEPT_FSL_EULA = "1"

1.  in core-image-base rootfs /etc/sudoers file not created. - How to create generate /etc/suoders file in bitbake?

Outcomes