When I tried creating a new windows service that watches a folder location, it worked. What I think is that folder locations doesn't work in a filewatcher. When I changed it back to a folder location, it didn't work. When I replaced the fileWatch variable with a specific file (including its directory), the windows service started. What seems to be the problem?Īfter many trials I've noticed that using only a folder directory (w/out file), the windows service doesn't work. I don't know what keeps the windows service not starting, the windows form simulator worked fine. StreamWriter sw = new StreamWriter(serviceStat, true) Watcher.Changed += new FileSystemEventHandler(OnChangedFolder) Watcher.Changed += new FileSystemEventHandler(OnChangedFile) XmlTextReader reader1 = new XmlTextReader(backupConfig) this loop reads whether the service will watch a file/folder this loop is for reading XML elements and assigning to variables XmlTextReader reader = new XmlTextReader(backupConfig)
Private static string backupConfig = static string serviceStat = static string fileFolderStat = override void OnStart(string args)įileSystemWatcher watcher = new FileSystemWatcher() Here's my code: protected override void OnStart(string args) When I put my code in the windows service OnStart() method the error showed up. I use my windows forms for debugging the code before I put it in my windows service. I have a separate windows forms that has a button that does exactly what my windows service's onstart is doing. Details are all provide by an XML Configuration that the windows service reads on start. I have a windows service that backs up folder/files, to a location if it reached the size limit. Some services stop automatically if they are not in use by other service or programs) when there's something wrong with my code, like non-existing drive paths, etc. Is there any way to connect Freenas to PowerChute Virtual Appliance ver.(The "service name" service on Local Computer started and then stopped.
Which gaves us an idea that we could compile PCNS driver, but we do not know how to do something similar on FreeNAS 9.3 (if it is possible) The only useful thing that we managed to find is this Unfortunately, this will not perfectly protect servers in some cases.
We managed to connect them to single network card (Services -> UPS -> driver *APC ups 3 (various AP9630), port IP address of management card, monitor user user on management card and monitor password authentification phraze on UPS device, remote monitor ticked +Ĭommand from cli upsc for verification). According to APC Powerchute Compatibility Matrix, FreeNAS (Freebsd) is not officially supported.
We installed Powerchute Network Shutdown 4.0 software for graceful shutdown of physical/virtual machines and only problem that we are currently having are two FreeNAS servers because we could not find a way how to connect them to PowerChute Virtual Appliance. Two APC UPS devices are put in redundant configuration (they behave as one). Ĭompany where I work recently purchased two APC Smart-UPS X 3000 that came with network management cards AP9631. After a lots of unsuccessful attempts to get this working, I would like to ask community for help.