debian /etc/shutdown.allow does not fire when trying to shut down computer - linux

i have a linux box where a remote management application should shut down the box. Those remote management application is running under a normal restrictive user (no root) and the shutdown does just not work.
I have created a file /etc/shutdown.allow and entered the name of that restricted user, but when i execute i get this error:
myuser/mybox:$ shutdown
command not found
also a shutdown -a is not recognized and this switch is also not mentioned in the shutdown manual
Is there a way to enable a user or a application running under a restricted user to shutdown the box at all?
INFO: a sudo shutdown of course is working from cmd-line, but does not enable the application to shut down the box and i would not be happy to let that application run as root user.
Anybody a idea?
Thank you.
INFO:
$ uname -a
Linux mybox 3.16.0-4-amd64 #1 SMP Debian 3.16.51-3 (2017-12-13) x86_64 GNU/Linux
$ cat /etc/issue
Debian GNU/Linux 8

You can only run shutdown as root user. Maybe you can run this using a sudo.

Related

Recover Windows Subsystem Root User Password for Linux

I use linux bash on my windows machine with developer mode windows subsystem setup for linux. I followed this guide to install and configure sudo: https://linuxhint.com/run-sudo-command-windows/ but I forgot my password and I don't know how to reset it. Since I don't use a GUI distribution of ubuntu I can't use the LIVE CD nor can I use the GRUP bootloader. What options do I have?

How to run a ReactJS application at startup on Beaglebone?

My main computer is running Ubuntu 18,04, I developed an application on ReactJS on FrontEnd, NodeJS on BackEnd and MySQL concerning the database ON beaglebone. .
More information about my BeagleBone :
root#beaglebone:~# uname -a
Linux beaglebone 3.8.13-bone71.1 #162 SMP Fri Oct 16 07:27:34 CST 2015 armv7l GNU/Linux
I want to run my application always at startup on BeagleBone
What can I do to make a script run as soon as it boots up ?
Short answer: Just like on any other device (including PC or Server) that runs a Linux distribution.
Some quick pointers:
Latest BeagleBone Images are Debian 9.4 based
Use an "IoT" image unless you really need the HDMI (or LCD) output and accept the lower performance.
Debian uses systemd to manage automatic starting and stopping of software services
Create a systemd service file that invokes a process you need (e.g. npm) as the desired user (probably 'debian'). There seem to be helper tools like service-systemd
reload systemd systemctl daemon-reload to make it aware of the new file
enable it systemctl enable myfancy.service
Both flavours of mySQL on Debian (mysql-server and mariadb-server) come with a systemd file already.

How to check server status in suse linux?

I have a below machine :
LSB Version: core-2.0-noarch:core-3.2-noarch:core-4.0-noarch:core-2.0-x86_64:core-3.2-x86_64:core-4.0-x86_64:desktop-4.0-amd64:desktop-4.0-noarch:graphics-2.0-amd64:graphics-2.0-noarch:graphics-3.2-amd64:graphics-3.2-noarch:graphics-4.0-amd64:graphics-4.0-noarch
Distributor ID: SUSE LINUX
Description: SUSE Linux Enterprise Server 11 (x86_64)
Release: 11
I have a server called as Xserver i need to check the status of server whether it is up/down/running.
What command should i use to check server status?
Is your 'Xserver' a some kind of Linux daemon or service?
If so you should be able to check it with the following command:
systemctl status xserver
You need to be sure that your service name is 'xserver' exactly!
You can find which services are running on your system by using this command:
chkconfig --list

VirtualBox: mounting shared folder fails during start-up, but succeed from shell

Problem description:
When I boot my VirtualBox Guest OS, the mounting of the shared file-system - which is referenced in /etc/fstab - fails.
However, after login - mount -a succeeds.
Details:
The boot process gets stuck here ...
... and pressing s continues the boot process, which finishes.
In the shell, I verify that my shared directory is not mounted:
But now, from the shell, the mount of the shared file-system succeeds:
What should I do to make my mount succeed during start-up?
Environment:
VirtualBox: 4.3.12.r93733
Host OS: Windows 7
Guest OS: Linux ubuntu 3.13.0-32-generic #57~precise1-Ubuntu x86_64 GNU/Linux
/etc/fstab
Relevant lines in /var/log/boot.log
You don't have to mount it, VitrualBox will make it for you. For me,these steps worked on my System (VirtualBox 5.0.10 on Windows 7 and Kubuntu 14.04 guest system):
In VirtualBox, configure your shared folder for your machine under 'Shared Folder'. Pick up the directory on your host system (e.g. D:\shared) and set a name for your guest system (e.g. shared).
Boot the guest system. Now you should have a mounted folder under \media\sf_shared.
Thats all. VirtualBox manages this for you.
You need to install VirtualBox Guest Additions properly and use VirtualBox Manager to specify share folders. The issue happens because the mount point is in place with root permissions. The default mount location is in /media/sf_.
You can change mount point with VBoxControl command. To change the mount point from /media/sf_... to /home/user/sf_... use the command:
sudo VBoxControl guestproperty set /VirtualBox/GuestAdd/SharedFolders/MountDir /home/user/
To check if that's working:
sudo VBoxControl guestproperty get /VirtualBox/GuestAdd/SharedFolders/MountDir

Brother QL-720NW, printing labels using CUPS & Ubuntu

I'm trying to get my Brother QL-720NW label printer working from an Ubuntu server. I'll briefly describe the process so far, and where I'm stuck.
First I installed CUPS and LPR and cupswrapper drivers from Brothers website, and now my QL-720NW shows up in the CUPS web interface. I set the default media size to fit my label(29x90mm). I clicked "Test print page" on the QL-720NW and it says "Sending data to printer." a few seconds, and then disappears and changing state to Idle, Accepting Jobs, Not Shared, Server Default. But my printer does nothing, not even a led light blinking.
My cups/error_log looks like this. I have googled the AddProfile failed error, and found someone suggesting it is a bug in Ubuntu 12.10, but I've also read that Arch users have had the same error, so I'm not sure. And the Uknown directive SystemGroup error is just a harmless error according to this site.
E [23/Apr/2013:12:20:47 +0200] Unknown directive SystemGroup on line 18 of /etc/cups/cupsd.conf.
W [23/Apr/2013:12:20:47 +0200] AddProfile failed: org.freedesktop.DBus.Error.UnknownMethod:No such interface `org.freedesktop.ColorManager' on object at path /org/freedesktop/ColorManager/devices/cups_QL_720NW
When I run lpstat -tl after trying to print a test page or a text file using lp test.txt, it says it's sending data to the printer. But the printer does nothing.
# lpstat -tl
scheduler is running
system default destination: QL-720NW
device for QL-720NW: usb://Brother/QL-720NW?serial=000K2Z658058
QL-720NW accepting requests since Tue 23 Apr 2013 12:45:56 PM CEST
printer QL-720NW is idle. enabled since Tue 23 Apr 2013 12:45:56 PM CEST
Sending data to printer.
So, does anyone have any suggestions where to go from here? Is there any other log files that might give me a clue of whats wrong?
I was able to get 64-bit Ubuntu working with the official QL-720NW drivers using their work-around:
http://welcome.solutions.brother.com/bsc/public_s/id/linux/en/faq_prn.html#f00081
apt-get install cups cups-bsd
apt-get install ia32-libs
dpkg -i --force-architecture ql720nwlpr-1.0.1-1.i386.deb
dpkg -i --force-architecture ql720nwcupswrapper-1.0.1-1.i386.deb
cp /usr/lib/cups/filter/brlpdwrapper* /usr/lib64/cups/filter
cp /usr/lib/cups/filter/brlpdwrapper* /usr/lib64/cups/filter
My Linux distro (uname -a):
Linux 3.2.0-40-virtual #64-Ubuntu SMP Mon Mar 25 21:42:18 UTC 2013
x86_64 x86_64 x86_64 GNU/Linux
I finally got it to print on my Ubuntu system. The problem seemed to be that the drivers from Brother is not 64bit compatible, and I was using a 64bit version of Ubuntu.
I tried on Debian first, after learning from #sampi that he got it to work on Debian. When installing the drivers I got an error message, which I didn't get on Ubuntu, suggesting a 32/64bit issue. So after installing the ia32-libs packages it worked on Debian. I then tried installing a 32bit version of Ubuntu on my server, and now the printer did work.
But I can only get the printer to work through wifi(both on Debian and Ubuntu). No success with the USB cable, but that's not an issue for me.
I have used a QL-720NW with Debian since September. Using first the QL-580N driver & later, once it got released, the QL-720NW driver. Prior to buying the printer I did contact brother support who, within a very helpful response, told me that the printer worked as a network printer with the older product's driver, but not over USB.
Given that you do not explicitly state that you need to print via USB, I suggest you try connecting the printer to your network & reconfigure cups to use that connection instead.
FWIW: On Debian testing, I just installed the drivers from the Brother site (version 1.0.1 for both) and the QL-720nw printed via USB with no issues. I didn't even have to force anything (I already had multiarch installed to support other stupid 32-bit-only software), nor use any workaround. I haven't yet tried to use it on a network.

Resources