I work on a development team and for each project we have a different server setup to emulate the environment of our customers. It can be hard to keep track of what I was doing on each server and where I need to start. In order to alleviate this problem I have started using a terminal multiplexer (tmux/screen).

My problem is on one of the servers that I work on, the project lead is constantly making mistakes and resetting the system. When that happens I lose all of my screens as well as time getting back to where I was and what I was doing.

All developers are given root access to the servers and I want to know if there is anyway I can set up the server so that my project lead gets a warning of users logged on or screens running when they decide to reset the server?

(If possible I'd like to include a message of what I'm running and why they should find a different solution to resetting the server. In my company this is the only project manager that resets the server on a daily basis.)

  • You can list the users with their current processes using the w command. – Ramesh Mar 20 '14 at 0:58

The wall command short for write-to-all was traditionally used to broadcast a message to all logged on users.

But I feel that communication needs to be addressed at a human level as well for your department to function properly.

who or w will show a list of logged in users, and whether their terminal is idle, giving some indication whether they are still active, but they could have background tasks running, which need to be shutdown gracefully.

It is not a good idea for everyone to be logged in as the same user since you can not tell who they actually are and leads to security issues. The sudo command is a good method to allow users or groups of users to run certain or any command as root or a particular user and the use of sudo is logged in /var/log/syslog or /var/log/messages or /var/log/auth which provides an audit trail. (Which log-file depends on your distribution).

Your company would be better off having a standard common environment, across servers, and maybe considering virtual servers, which provide an isolated instance for testing, development and integration, production etc. Your question brings up quite a few topics, it's difficult to address them all with such a short answer.

I hope others will bring up or point you to some good documentation on industry best practices, because it sounds as though you have a number of issues to address.

edit 1 @Dodzi Dzakuma, well that could be one way to go, but I wonder why your system needs to be shutdown so often ?Maybe addressing the underlying problem is better in the long run, instead of developing a script around shutdown. Also, shutdown should be run by root, which is why I suggested using sudo. Could you adopt an alternative method of comminication amongst yourselves, via a chat server which is independent to the server(s) you are working on ?

@slm tks.

  • Congrats on getting to 3k! – slm Mar 20 '14 at 1:16
  • Yes. We have a lot of issues to address. Too many actually. I agree with you on all points. Unfortunately, since I am an 'underling' any advice I give is ignored. Everyone shouldn't be allowed root access and the server (virtual or not) shouldn't need to reset everyday. The project manager doesn't run who or ps aux before resetting and doesn't notify anyone as to why the server was reset or before resetting. The only hope I have for staying sane is issuing a warning from my user account to the administrator along the lines of 'I have processes running. Contact me before restarting.' – Dodzi Dzakuma Mar 20 '14 at 1:20
  • Would it be a good idea to replace the shutdown binary with a shutdown bash script of my own that sends out a wall message and then waits for confirmation from the administrator? – Dodzi Dzakuma Mar 20 '14 at 1:22
  • In my company no other project leader resets their server as much as the one I'm working with now. This server gets reset almost daily. As for the communication thing, it's really tricky. I'm an American working in Japan with a Japanese company. Titles, status and years of work hold more weight than the value of the advice, sensibility or attention to best practices. Like I've said, I've suggested lots of places for improvement. I agree with everything that you say, but my suggestions mean nothing and no time will be taken for improvement. I have root access so I can do what I think will help. – Dodzi Dzakuma Mar 20 '14 at 2:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.