Notices


Reply
Thread Tools
Posts: 136 | Thanked: 263 times | Joined on Nov 2012 @ Germany
#91
Originally Posted by xes View Post
..if triggered by the sshd daemon the nohup.out is owned by root, then when an ssh client sessions tries to created the same nohup.out it can't exec the command since the file is still there and owned by root.

Generally talking, place in the home folder a nohup.out file is not a good choice. It would be better to move it in some temporary folder.
Thanks. Are you sure? When I delete /home/user/nohup.out and then log in to the server daemon, I can't see a nohup.out in /home/user. It is placed somewhere I couldn't find out. It's always placed "where it was started from". Could it be that your /home/user/nohup.out was written by another root process?

Did you try deleting it?
__________________
OpenSSH Status Widget (N900)
Start / stop / kill / restart / autostart server - View server status - View server and client connections - Switch wifi pm automatically

Simpler Brightness Applet (N900) - A variation of the Simple Brightness Applet
Short tap to toggle "keep backlight on" - Long tap to open display settings

Last edited by rasmarc; 2016-12-03 at 23:48. Reason: typo
 

The Following User Says Thank You to rasmarc For This Useful Post:
Posts: 136 | Thanked: 263 times | Joined on Nov 2012 @ Germany
#92
Anyway, in the end it makes no difference who put the file there .
Why not simply change read/write permissions to 666 if needed... and let the devil be in the detail.

So I added a check for /home/user/nohup.out every time user logs into a server in the network - to make sure nohup can handle the file.... should do it.

Ah, and I had forgotten to link this feature with the wifi pm setting "keep off: yes/no" - done now.

If the fix and the feature work, I'll have to leave it at that. Time is eating me up a bit (even a bit more). Of course, reporting a bug is welcome at any time.

v2.1.0 will be uploaded to Extras-devel if there are no more obstacles occurring. I think it can be promoted to Extras-testing.

@xes ...please test the fix in v2.1.0-rc2.
Attached Files
File Type: deb openssh-status-widget_2.1-0rc2_armel.deb (43.2 KB, 58 views)
__________________
OpenSSH Status Widget (N900)
Start / stop / kill / restart / autostart server - View server status - View server and client connections - Switch wifi pm automatically

Simpler Brightness Applet (N900) - A variation of the Simple Brightness Applet
Short tap to toggle "keep backlight on" - Long tap to open display settings
 

The Following 2 Users Say Thank You to rasmarc For This Useful Post:
Posts: 638 | Thanked: 1,692 times | Joined on Aug 2009
#93
@rasmarc
thank you for looking into this feature and problem.
Anyway, while your are partially right since the problem is not in fact with the sshd creating the nohup.out file, the real trouble is with the use of nohup in general.

Now, every time you run "ssh HOST" your receive a message "..appending to nohup.out" and a file nohup.out will be created in the folder where you are.
After some time this will result in a filesystem filled of nohup.out files leaved there in any folder where you were positioned while starting an ssh session.

Then, if you are in the /home/user folder and as root you run "ssh HOST" you will leave there a nohup file owned by root.

All this to explain why the nohup approach is not a good idea, especially if you don't use a temporary folder somewhere in /tmp to leave the output files.

After this complaints thank you for this applet, i think is very useful for who, like me spends his life over ssh.
 

The Following User Says Thank You to xes For This Useful Post:
Posts: 136 | Thanked: 263 times | Joined on Nov 2012 @ Germany
#94
@xes Thank you very much, I was thinking nohup.out will always be put in the home directory. As it is now, it's almost a bug . I had a closer look at nohup... should have done before, and it seems to be a simple solution redirecting nohup.out to /dev/null, or is there any need for it?
Code:
nohup <command> >/dev/null 2>&1
Better this way?
__________________
OpenSSH Status Widget (N900)
Start / stop / kill / restart / autostart server - View server status - View server and client connections - Switch wifi pm automatically

Simpler Brightness Applet (N900) - A variation of the Simple Brightness Applet
Short tap to toggle "keep backlight on" - Long tap to open display settings

Last edited by rasmarc; 2016-12-04 at 15:27.
 

The Following 2 Users Say Thank You to rasmarc For This Useful Post:
Posts: 136 | Thanked: 263 times | Joined on Nov 2012 @ Germany
#95
No more nohup.out. Works without annoying output now?
Attached Files
File Type: deb openssh-status-widget_2.1-0rc3_armel.deb (43.1 KB, 57 views)
__________________
OpenSSH Status Widget (N900)
Start / stop / kill / restart / autostart server - View server status - View server and client connections - Switch wifi pm automatically

Simpler Brightness Applet (N900) - A variation of the Simple Brightness Applet
Short tap to toggle "keep backlight on" - Long tap to open display settings
 

The Following 2 Users Say Thank You to rasmarc For This Useful Post:
Posts: 136 | Thanked: 263 times | Joined on Nov 2012 @ Germany
#96
v2.1-1 is in Extras-devel. If no one objects I'll promote it to Extras-testing.

Here's the changelog:
* extended wifi pm feature to support client connections
* removed all "nohup.out" messages on login
* button "Connections" (when tracking is disabled) renamed to "Server connections"
* option "Stop server when not connected" moved to section "OpenSSH Options"
* bugfix: tracker subroutine could rarely fool wifi pm script
* bugfix: reverse section order function messed up due to recent changes
__________________
OpenSSH Status Widget (N900)
Start / stop / kill / restart / autostart server - View server status - View server and client connections - Switch wifi pm automatically

Simpler Brightness Applet (N900) - A variation of the Simple Brightness Applet
Short tap to toggle "keep backlight on" - Long tap to open display settings
 

The Following 4 Users Say Thank You to rasmarc For This Useful Post:
Posts: 136 | Thanked: 263 times | Joined on Nov 2012 @ Germany
#97
There's unexpected news:

While the latest version works well using wlan as it seems, using ssh over usb network makes it buggy and even worse unusable. The latter is due to a seeming bug in sshd regarding "ForceCommand". Login hangs.

This means the wifi pm feature has to be rewritten using a different approach than using "ForceCommand" in sshd config in order to make the widget compatible with usb connections.

After a search I found out how to count just wlan connections without gettings triggers from the users logging in. Apparently this is my friend now: "netstat -ant | grep :22.*ESTABLISHED", because he lets me count ips.

In case you want to install the widget as it is and use ssh over usb you have to comment out "ForceCommand" in /etc/ssh/sshd_config. As a result the wifi pm feature can only be started manually using the wifi pm button. It will then be active as long as the last user logs out, including usb connections. Therefore a fix is attached (if it works as expected). After removing the suffix, making it executable and copying it into the folder

"/usr/lib/openssh"

wifi pm should switch back to "on" when the last wlan connection is closed (with a max. delay of 40 sec).
Attached Files
File Type: txt wifi-power-management.txt (1.0 KB, 59 views)
__________________
OpenSSH Status Widget (N900)
Start / stop / kill / restart / autostart server - View server status - View server and client connections - Switch wifi pm automatically

Simpler Brightness Applet (N900) - A variation of the Simple Brightness Applet
Short tap to toggle "keep backlight on" - Long tap to open display settings

Last edited by rasmarc; 2016-12-09 at 03:29.
 

The Following 3 Users Say Thank You to rasmarc For This Useful Post:
Posts: 136 | Thanked: 263 times | Joined on Nov 2012 @ Germany
#98
I've already done something working (I want to say there's an alternative approach that works), but I'm trying to find a chance for OpenSSH to do a trigger on login/logout using PAM.. it doesn't work.

Can anybody tell me if this version of OpenSSH supports PAM?

"ldd /usr/sbin/sshd" does not list any libpam. I was just reading about this for the first time and don't have a clear view at all.

If PAM could be used for triggering there would be no more need for a tracking routine (consuming power and therefore has to remain simple).

Is PAM support included in N900's OpenSSH version?

__________________
OpenSSH Status Widget (N900)
Start / stop / kill / restart / autostart server - View server status - View server and client connections - Switch wifi pm automatically

Simpler Brightness Applet (N900) - A variation of the Simple Brightness Applet
Short tap to toggle "keep backlight on" - Long tap to open display settings

Last edited by rasmarc; 2016-12-13 at 01:00.
 

The Following User Says Thank You to rasmarc For This Useful Post:
Posts: 1,378 | Thanked: 1,604 times | Joined on Jun 2010 @ Göteborg, Sweden
#99
Originally Posted by rasmarc View Post
Is PAM support included in N900's OpenSSH version?

I believe it is, as authen.pam is included in the source and in the makefile.

I am writing this shattered by the utterly cr*p news I read upon logging in. Win7Mac....

Last edited by handaxe; 2016-12-14 at 13:24. Reason: as usual, typing
 

The Following 3 Users Say Thank You to handaxe For This Useful Post:
Posts: 136 | Thanked: 263 times | Joined on Nov 2012 @ Germany
#100
Changelog for v2.2.0:
* wifi pm feature partly rewritten for compatibility with usb connections
* wifi pm feature partly rewritten to save all parameters in the config file
* fixed bug in client related wifi pm - "user" couldn't tell sshIP at least sometimes
* added option to show connections overview in the dialog window: server/clients, wlan/usb
* changed from counting log-ins to counting established connections

Changelog for v.2.2.3:
* bugfix: when connecting just locally connections were not counted properly - third time lucky
Attached Images
 
__________________
OpenSSH Status Widget (N900)
Start / stop / kill / restart / autostart server - View server status - View server and client connections - Switch wifi pm automatically

Simpler Brightness Applet (N900) - A variation of the Simple Brightness Applet
Short tap to toggle "keep backlight on" - Long tap to open display settings
 

The Following 3 Users Say Thank You to rasmarc For This Useful Post:
Reply

Thread Tools

 
Forum Jump


All times are GMT. The time now is 16:38.