Changeset 1856
- Timestamp:
- 23/09/2007 10:18:20 (4 years ago)
- Location:
- box/chris/general/bin/bbackupd
- Files:
-
- 3 edited
-
BackupDaemon.cpp (modified) (2 diffs)
-
Win32ServiceFunctions.cpp (modified) (5 diffs)
-
Win32ServiceFunctions.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
box/chris/general/bin/bbackupd/BackupDaemon.cpp
r1855 r1856 129 129 , mInstallService(false), 130 130 mRemoveService(false), 131 mRunAsService(false) 131 mRunAsService(false), 132 mServiceName("bbackupd") 132 133 #endif 133 134 { … … 348 349 if (mInstallService) 349 350 { 350 return InstallService(rConfigFileName.c_str() );351 return InstallService(rConfigFileName.c_str(), mServiceName); 351 352 } 352 353 353 354 if (mRemoveService) 354 355 { 355 return RemoveService(); 356 } 356 return RemoveService(mServiceName); 357 } 358 359 Logging::SetProgramName("Box Backup (" + mServiceName + ")"); 357 360 358 361 int returnCode; -
box/chris/general/bin/bbackupd/Win32ServiceFunctions.cpp
r1853 r1856 200 200 } 201 201 202 int InstallService(const char* pConfigFileName )202 int InstallService(const char* pConfigFileName, const std::string& rServiceName) 203 203 { 204 204 if (pConfigFileName != NULL) … … 236 236 237 237 std::string cmdWithArgs(cmd); 238 cmdWithArgs += " -s ";238 cmdWithArgs += " -s -S \"" + rServiceName + "\""; 239 239 240 240 if (pConfigFileName != NULL) … … 245 245 } 246 246 247 std::string serviceDesc = "Box Backup (" + rServiceName + ")"; 248 247 249 SC_HANDLE newService = CreateService( 248 250 scm, 249 SERVICE_NAME,250 "Box Backup",251 rServiceName.c_str(), 252 serviceDesc.c_str(), 251 253 SERVICE_ALL_ACCESS, 252 254 SERVICE_WIN32_OWN_PROCESS, … … 313 315 } 314 316 315 int RemoveService( void)317 int RemoveService(const std::string& rServiceName) 316 318 { 317 319 SC_HANDLE scm = OpenSCManager(0,0,SC_MANAGER_CREATE_SERVICE); … … 324 326 } 325 327 326 SC_HANDLE service = OpenService(scm, SERVICE_NAME,328 SC_HANDLE service = OpenService(scm, rServiceName.c_str(), 327 329 SERVICE_ALL_ACCESS|DELETE); 328 330 DWORD err = GetLastError(); -
box/chris/general/bin/bbackupd/Win32ServiceFunctions.h
r1853 r1856 13 13 #define WIN32SERVICEFUNCTIONS_H 14 14 15 int RemoveService ( void);16 int InstallService (const char* pConfigFilePath );15 int RemoveService (const std::string& rServiceName); 16 int InstallService (const char* pConfigFilePath, const std::string& rServiceName); 17 17 int OurService (const char* pConfigFileName); 18 18
Note: See TracChangeset
for help on using the changeset viewer.
