maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Applications (https://talk.maemo.org/forumdisplay.php?f=41)
-   -   [M5] [Announce] OpenSSH status widget (https://talk.maemo.org/showthread.php?t=95429)

rasmarc 2015-05-08 12:29

Re: [Announce] OpenSSH status widget
 
Quote:

Originally Posted by handaxe (Post 1469696)
rootsh....

Difficult to remember, but I probably set a root password (?)

I've set a root password as well, but sudo won't ask for it, so that's probalbly not the issue. You could have a look at the list of installed packages in the Application manager->Uninstall, and check if you have Sudser installed.

If so, an exclusion can be added not to ask for a password for the relevant commands (i never did this before, will have to try). And if that works an option in the configuration dialog would be useful.

Edit:
I was wrong here - the opposite is true. Sudser let's you execute sudo without a password. I'll have a look on how to execute the relevant commands without a password.

rasmarc 2015-05-08 12:54

Re: [Announce] OpenSSH status widget
 
Quote:

Originally Posted by ThomasAH (Post 1469697)
That was it! :) I hadn't run the OSW Options configuration yet (I didn't know it existed). After configuring it I just rebooted the phone, now it's working! :D I tested it and it seems to work as expected (See attachments)

Perhaps you chould add a instruction to the first post that you should run the OSW Options configuration once before using it? I couldn't find anywhere that this was necessary.

It should not be necessary to run OSW Options first. A typo in conjunction with your system settings was probably the reason for this again. I will wait uploading the fix and see if handaxe's issue gets solved quickly.

Nice that it works now. :cool:

rasmarc 2015-05-08 20:21

Re: [Announce] OpenSSH status widget
 
v1.2-1 is uploaded!

Main change: the sudo password issue is solved. I put all sudo commands in an extra shell script and added an entry in the sudoers.d directory.

@handaxe: This could work for you. I uninstalled Sudser, which made sudo ask me for a password and the widget not switch anymore, just as you reported. This new version works properly again on my device.

Changes:
*bugfix: typo led to empty button on fresh install
*enabled sudo commands without password

handaxe 2015-05-11 16:00

Re: [Announce] OpenSSH status widget
 
Quote:

Originally Posted by rasmarc (Post 1469724)
@handaxe: This could work for you. I uninstalled Sudser, which made sudo ask me for a password and the widget not switch anymore, just as you reported. This new version works properly again on my device.

Fook, it still will not start for me. Will take a look. But thanks, this is very nice.

Ok, if I run

Code:

/usr/sbin/openssh-status.sg start_sshd
it gives an operation not permitted error.

rasmarc 2015-05-11 16:21

Re: [Announce] OpenSSH status widget
 
Quote:

Originally Posted by handaxe (Post 1469998)
Fook, it still will not start for me. Will take a look. But thanks, this is very nice.

Well, that's interesting. :)

I guess you mean the button appears in the status menu but it won't start/stop the server. Maybe your device doesn't update the sudoer's list.

You can try as root:
Code:

/usr/sbin/update-sudoers
Another question:
1. Start the configuration dialog
2. Switch "Run server at system startup"
3. Switch one of the widget's options
3. Close and re-open the configuration dialog

Did it save any configuration?

handaxe 2015-05-11 16:37

Re: [Announce] OpenSSH status widget
 
Quote:

Originally Posted by rasmarc (Post 1470000)

Another question:
1. Start the configuration dialog
2. Switch "Run server at system startup"

Ha, thanks for the reminder - I forgot to mention previously that it did not save "Run server at system startup" option but did the others.

Now, having set it, it sticks, and then the widget works as advertised. Brilliant & thanks.

handaxe 2015-05-11 21:49

Re: [Announce] OpenSSH status widget
 
Strange, but after some time, the app indicator "forgets" that the server is enabled. Pressing the drop-drown generates an "already running, updating screen" (or words to that effect) message and the indicator reappears.

Is this "sleep" related?

rasmarc 2015-05-12 09:04

Re: [Announce] OpenSSH status widget
 
Quote:

Originally Posted by handaxe (Post 1470064)
Strange, but after some time, the app indicator "forgets" that the server is enabled. Pressing the drop-drown generates an "already running, updating screen" (or words to that effect) message and the indicator reappears.

Is this "sleep" related?

This needs a fix/workaround. It happens that the server status is recognized as off even when it should be on. The command for checking is
Code:

ps aux | grep -c usr/sbin/sshd
which i think can be assumed to be reliable.

Anyway, when "Stop tracking status when off" is enabled (you do have it enabled?) the widget immediately stops tracking as soon as status OFF is recognized. To handle those occasional short intervals correctly, when the sshd daemon seems non-listed in the process list, a time-out needs to be added before tracking stops.

ThomasAH 2015-05-12 09:26

Re: [Announce] OpenSSH status widget
 
Quote:

Originally Posted by rasmarc (Post 1470104)
Anyway, when "Stop tracking status when off" is enabled (you do have it enabled?) the widget immediately stops tracking as soon as status OFF is recognized. To handle those occasional short intervals correctly, when the sshd daemon seems non-listed in the process list, a time-out needs to be added before tracking stops.

I have an oddity that may be a related to what you describe above:
Even when the server is turned off, every once in a while the 'SSH' icon appears in the top tray-icon area (right of the clock) very briefly. It usually happens when I (dis)connect from a internet connection, or update my repositories. It even happens when "Stop tracking status when off" is enabled.

Do you have any idea why this might happen?

rasmarc 2015-05-12 14:46

Re: [Announce] OpenSSH status widget
 
Quote:

Originally Posted by ThomasAH (Post 1470109)
Every once in a while the 'SSH' icon appears in the top tray-icon area (right of the clock) very briefly. It usually happens when I (dis)connect from a internet connection, or update my repositories. It even happens when "Stop tracking status when off" is enabled.

Do you have any idea why this might happen?

I have no explanation for this so far. This is not triggered by the widget itself directly. Maybe the used python command for deleting the icon is somehow incomplete (?). It needs more investigation. :rolleyes:

The timeout for switching the display to off is now added. For the moment I used the shortest time possible (just one more checking, that is 2 seconds) not to delay updating the display to OFF too much. This affects only one situation, when the server is waiting for 1 connection to close (and when the server is stopped externally of course).

v1.2-2 is uploaded.

Changes:
*added timeout to avoid mistaken status off
*cosmetic change: message "display updated"


All times are GMT. The time now is 15:23.

vBulletin® Version 3.8.8