Dedicated Server question

Quick question. We are ms SQL express 2014 on a dedicated box running server 2012r2 standard. I have the messaging service setup and everything is working fine. The only thing I was wondering is some items I have setup to only run on the server like database backup at the end of every shit. We have breakfast lunch and dinner. For this to work I have to have the samba program open on the server and logged in as the admin user… Is there a way to have the program auto start and run in the background on the server? Maybe minimized to the system tray to know that its for sure running when you go into the server?

You can set tasks for it and even have a restart if it failed for some reason. Why does it have to be logged in?

My mistake it does not need to be logged into samba what I meant was the administrator on the server has to be logged in for samba to be on… I’m thinking of just converting it to a service so that it will run in the background on the server. That way even if the server happens to reboot over night for some reason the tasks can still run even if the administrator hasn’t logged into the server.

1 Like

Ok, I got SambaPOS working as a service when the pc boots without administrator needing to be logged in. This is useful for triggers and other things that need to be ran from a dedicated server.

To start off you will first need to download and install the windows server 2003 resource tool kit. (This installs on any system)

The link for Windows Server 2003 Resource Tool Kit: http://www.microsoft.com/en-us/download/details.aspx?id=17657

Then you will need to add an entry in the registry to create the service, below is a sample of my service config. You can change the name and paths to whatever you like.

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SAMBAPOS_SERVER]
“Type”=dword:00000010
“Start”=dword:00000002
“ErrorControl”=dword:00000001
“ImagePath”=hex(2):43,00,3a,00,5c,00,50,00,72,00,6f,00,67,00,72,00,61,00,6d,00,
20,00,46,00,69,00,6c,00,65,00,73,00,20,00,28,00,78,00,38,00,36,00,29,00,5c,
00,57,00,69,00,6e,00,64,00,6f,00,77,00,73,00,20,00,52,00,65,00,73,00,6f,00,
75,00,72,00,63,00,65,00,20,00,4b,00,69,00,74,00,73,00,5c,00,54,00,6f,00,6f,
00,6c,00,73,00,5c,00,73,00,72,00,76,00,61,00,6e,00,79,00,2e,00,65,00,78,00,
65,00,00,00
“DisplayName”=“SAMBAPOS_SERVER”
“WOW64”=dword:00000001
“ObjectName”=“LocalSystem”
“DependOnService”=hex(7):54,00,63,00,70,00,69,00,70,00,00,00,00,00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SAMBAPOS_SERVER\Parameters]
“AppDirectory”=“C:\Program Files (x86)\SambaPOS4”
“Application”=“C:\Program Files (x86)\SambaPOS4\Samba.Presentation.exe”

Once completed you will need to reboot your system and go into the services.msc console and check to see if the service is running… if so you should be able to open the task manager and see the sambapos process running in the backgroud. I also went into the service and changed it from running as administrator instead of a system account.

1 Like

Seems like a bit of overkill to set SambaPOS to run as a Service - but if it works for you then that is great.

My recommendation would have been to create a BAT file that contains the commands (SQLCMD) to execute a DB backup. Then put that BAT file into the Windows Task Scheduler.

Personally, I run DB backup on Application Ending Event, if the WorkPeriod is Closed. I also have a button (Automation Command) within SambaPOS to instigate a backup on-demand.

One thing I learned about @antasp3136 is he loves overkill haha. Not a bad thing it stretches capabilities and gives us more idea of whats possible.

3 Likes