nssm does not work

52 views
Skip to first unread message

rāma

unread,
Jun 3, 2019, 2:58:02 AM6/3/19
to web2py-users
I am using the latest version of NSSM - the Non-Sucking Service Manager; both 2.24 and the prelease build 2.2.4-101 .

Unfortunately for me, NSSM sucked big time and trying to get it working with web2py was an utter waste of time.

Tried
-K; nothing and tried
-X; nothing anyways

Env:
Python3.7
Windows 10

Can anyone advise what is supposed to happen after issuing -K app1 ? A windows pop-up or the local webserver starts ? There is no outcome clearly explained in any material I have gone through so far.

Dave S

unread,
Jun 4, 2019, 3:30:31 PM6/4/19
to web2py-users

A scheduler process has no user interface (UI).  It runs in the background, looking for tasks that are scheduled to start.  It then fires off a subprocess that runs that task, and records the results in the database.  A normal HTTP request can add a task to the queue, or check the status of task.  Tasks often do their work by "side effects": creating a file, sending email, changing values in a database table.

I have several tasks that generate email in response to an upload and automated scanning of the file.  I also handle my session cleanup with a task.  I keep an eye on tasks by using Appadmin or through the database console application (sqlite3 from the command line, or psql).  On a system where Appadmin isn't set up,

select * from scheduler_task where status == 'QUEUED';  -- or 'FAILED' or 'COMPLETE'
select * from scheduler_run where id > (select max(id) from scheduler_run) - 5;
I don't recommend doing INSERT or UPDATE on the tables; using the API is much safer.  The .schema should be considered implementation-dependent, rather than public.

One of the other things I use the Scheduler for is getting remote files.  I do this for a "toy" server I use at home, running on my Windows 10 laptop.  I open a command window, and do my -K  there, and then ignore that cmd afterwards .. Windows doesn't have the foreground/background support in CMD that a Unix/Linux shell has.

I haven't used NSSM.  I have set up a buildbot client using the built-in Windows task tools (schtasks /create and schtasks /run with an appropriate xml file); those techniques should work for a Scheduler process, but I haven't tried that yet, as I haven't yet needed automatiion of starting the Scheduler process.
 
/dps

 

Niphlod

unread,
Jun 5, 2019, 4:54:53 AM6/5/19
to web2py-users
what happened may differ from what you thought it should happen which may differ from what needs to happen.

said that, nssm just bootstrap the process. the fact that you have a service up&running may already indicate that everything is running smoothly but if you wanna do a check, open the task manager, go to details, see if there's a web2py running (it may be useful to select the column holding the command line)

rāma

unread,
Jun 6, 2019, 5:58:44 PM6/6/19
to web2py-users
Thank you Dave and Niphlod for your responses. It helped me troubleshoot my issues. Forum useful as always!

Dave S

unread,
Jun 7, 2019, 10:01:09 PM6/7/19
to web2py-users


On Wednesday, June 5, 2019 at 1:54:53 AM UTC-7, Niphlod wrote:
what happened may differ from what you thought it should happen which may differ from what needs to happen.

said that, nssm just bootstrap the process. the fact that you have a service up&running may already indicate that everything is running smoothly but if you wanna do a check, open the task manager, go to details, see if there's a web2py running (it may be useful to select the column holding the command line)

Simone, I always enjoy posts by the masters.

Did you see the thread asking about scaling?  You have experience with a different infrastructure than I do.

/dps


 
Reply all
Reply to author
Forward
0 new messages