adi
Posts: 7
Joined: Tue Jun 16, 2020 11:32 am

Export server - run as system user

I'm having trouble setting up the export server to run on a OS system user in windows, so that the server will start up automatically on reboot of the server. Currently i have tried to run it with forever and pm2, and starting it via batch script through Scheduled tasks as system user.

I haven't been able to make either work.

Anyone who have solved this problem on windows?
pawel_d
Posts: 1910
Joined: Thu Jun 02, 2016 10:28 am

Re: Export server - run as system user

Hi,

I'm not sure if the Forever package allows to restart scripts along with reboot of a server but from what I know PM2 does. Take a look at the following article that explains how it can be done under the Windows machine: https://blog.cloudboost.io/nodejs-pm2-s ... 0906328d75.

Best Regards.
Paweł Dalek
Highcharts Developer
adi
Posts: 7
Joined: Tue Jun 16, 2020 11:32 am

Re: Export server - run as system user

Bringing this post back to life hopefully - as the issue hasent been solved.

Updated information.

I've installed highchart server through NPM on my machine. Here i have created a .bat file that contains the highcharts command aswell as some parameters like logging, hostname, tempdir etc.

This .bat works just fine, server runs, produces images etc.
The same is true, when i run this .bat file through a windows scheduled task, where the identity user, is my own personal user. The server runs fine in the background through windows task scheduler, produces and returns images etc.

The problem arises when i switch the identity user of the windows scheduled task to "SYSTEM". (this is so that on a production enviroment, the server would start up automatically when the OS restarts). When running the 'system' identity i just cant' make it work.

I've made sure that the npm package is installed globally on my machine.
I've also played around with the path's inside the .bat file aswell as the "start in" optional parameter of the scheduled task, to make sure that all the path's etc are available from where the system user starts the task/bat from, but this hasen't made any difference.

Maybe i am missing something? I don't see any reason why it shouldn't work, if it works with a personal user.
dominik.c
Posts: 2081
Joined: Fri Aug 07, 2020 7:07 am

Re: Export server - run as system user

Hello adi!

Thanks for contacting us!

Thanks for the description of your problem. Let me ask you two questions. Is your problem only related to Windows? You have your own config, as far as I understand, right? Could you share it with me, so I could see how all the things are set up? :)

Best regards!
Dominik Chudy
Highcharts Developer
adi
Posts: 7
Joined: Tue Jun 16, 2020 11:32 am

Re: Export server - run as system user

dominik.c wrote: Fri Nov 13, 2020 1:14 pm Hello adi!

Thanks for contacting us!

Thanks for the description of your problem. Let me ask you two questions. Is your problem only related to Windows? You have your own config, as far as I understand, right? Could you share it with me, so I could see how all the things are set up? :)

Best regards!
Hi Dominik

That is correct. I am testing this on my windows machine since this will be deployed to a virtual server, which is also running windows OS.

The content of my .bat file/config is as follows.

highcharts-export-server --enableServer 1 --host hse.domain.local --tmpDir C:\HighchartsExportServer\tmp --logDest C:\HighchartsExportServer\logs --logLevel 4

Issues only arise when you try to run the windows scheduled task as 'system' instead of the personal user account.
pawel_d
Posts: 1910
Joined: Thu Jun 02, 2016 10:28 am

Re: Export server - run as system user

Hi adi,

It looks more like a problem with the permissions under Windows OS rather than a problem with the exporting server. I was able to successfully run the script on startup under Windows 8.1 machine. Take a look at the following article: https://www.windowscentral.com/how-crea ... windows-10. In my case both methods (look for 'Run batch file on schedule' and 'Run batch files on startup') for running a script on startup worked. In case of further problems, this article might be helpful: https://helpdeskgeek.com/help-desk/fix- ... -bat-file/ too.

Best Regards,
Paweł Dalek
Paweł Dalek
Highcharts Developer
adi
Posts: 7
Joined: Tue Jun 16, 2020 11:32 am

Re: Export server - run as system user

pawel_d wrote: Mon Nov 16, 2020 1:45 pm Hi adi,

It looks more like a problem with the permissions under Windows OS rather than a problem with the exporting server. I was able to successfully run the script on startup under Windows 8.1 machine. Take a look at the following article: https://www.windowscentral.com/how-crea ... windows-10. In my case both methods (look for 'Run batch file on schedule' and 'Run batch files on startup') for running a script on startup worked. In case of further problems, this article might be helpful: https://helpdeskgeek.com/help-desk/fix- ... -bat-file/ too.

Best Regards,
Paweł Dalek
Hi Pawel

Thanks for your response - did you run your scheduled task under the system account like so:
Attachments
hse_img.PNG
hse_img.PNG (18.84 KiB) Viewed 2940 times
pawel_d
Posts: 1910
Joined: Thu Jun 02, 2016 10:28 am

Re: Export server - run as system user

Hi adi,

Yes, I have checked both, on my local account and SYSTEM, and in both cases the task runs on system startup. All I can think of to make it work is to place the .bat file in a path that is accessible (that was a problem when I placed it in some nested folder, once placed on the desktop, the task works like a charm).

Best Regards,
Paweł Dalek
Paweł Dalek
Highcharts Developer
adi
Posts: 7
Joined: Tue Jun 16, 2020 11:32 am

Re: Export server - run as system user

Could i have you post the placement of your .bat file here aswell as the contents of your bat file for comparison? :)
adi
Posts: 7
Joined: Tue Jun 16, 2020 11:32 am

Re: Export server - run as system user

Hello Pawel

I have resolved the issue.

The issue was the installation of highcharts export server on the machine not being properly added to SYSTEM enviroment variables. So node, npm and everything was accessible for the SYSTEM user but the 'highcharts-export-server' was not available in the cmd window when the .bat script ran as SYSTEM. There must have been some kind of error along the way, as i have installed and reinstalled all the dependencies and the npm package itself globally a few times in my bug hunt.

Thanks for your help! :)
pawel_d
Posts: 1910
Joined: Thu Jun 02, 2016 10:28 am

Re: Export server - run as system user

Hi adi,

That's great to hear. In case of any further technical questions, feel free to contact us again.

Best Regards,
Paweł Dalek
Paweł Dalek
Highcharts Developer
softwarea
Posts: 1
Joined: Fri Nov 19, 2021 8:56 am

Re: Export server - run as system user

@adi: I am having the same problem as you had. Do you remember what you added to Environment variables > System variables > Path exactly? I can't figure it out. Would be really nive if you could help me.
mateusz.b
Posts: 2006
Joined: Tue Jul 13, 2021 11:34 am

Re: Export server - run as system user

Hello softwarea,

Welcome to our forum!

I saw that you haven't got an answer for your question for a while now. Unfortunately I don't know too much about systems permissions, we provide support strictly related to Highcharts so I can't really help you. However, I just wanted to suggest you asking that quesiton on forum like Stack Overflow. I think you can expect more accurate answer there for this specific topic.

For any questions related to Highcharts feel free to contact us!
Regards!
Mateusz Bernacik
Highcharts Developer

Return to “Highcharts Usage”