CMS 3D CMS Logo

UnixSignalService.cc
Go to the documentation of this file.
1 /*----------------------------------------------------------------------
2 
3  UnixSignalService: At present, this defines a SIGUSR2 handler and
4  sets the shutdown flag when that signal has been raised.
5 
6  This service is instantiated at job startup.
7 
8  ----------------------------------------------------------------------*/
9 #include <iostream>
10 #include <cstdlib>
11 
13 
15 
19 
20 namespace edm {
21  namespace service {
23  public:
24  explicit UnixSignalService(ParameterSet const& ps);
26 
27  static void fillDescriptions(ConfigurationDescriptions& descriptions);
28 
29  private:
31  }; // class UnixSignalService
32  } // end of namespace service
33 } // end of namespace edm
34 
35 namespace edm {
36 
37  namespace service {
38 
40  : enableSigInt_(pset.getUntrackedParameter<bool>("EnableCtrlC")) {
42  if (enableSigInt_)
44  }
45 
47 
50  desc.addUntracked<bool>("EnableCtrlC", true)
51  ->setComment(
52  "If 'true', you can stop a cmsRun job gracefully by sending it a '<control> c' keyboard interrupt (i.e. "
53  "SIGINT).");
54  descriptions.add("UnixSignalService", desc);
55  descriptions.setComment(
56  "This service sets up unix signal handlers for the unix signal SIGUSR2 and optionally SIGINT"
57  " so that when cmsRun is sent a signal the application will stop processing and shut down gracefully.");
58  }
59  } // end of namespace service
60 } // end of namespace edm
61 
ConfigurationDescriptions.h
service
Definition: service.py:1
edm::service::UnixSignalService::UnixSignalService
UnixSignalService(ParameterSet const &ps)
Definition: UnixSignalService.cc:39
electrons_cff.bool
bool
Definition: electrons_cff.py:372
edm::serviceregistry::ParameterSetMaker
Definition: ServiceMaker.h:54
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
edm::service::UnixSignalService::~UnixSignalService
~UnixSignalService()
Definition: UnixSignalService.cc:46
edm::service::UnixSignalService
Definition: UnixSignalService.cc:22
UnixSignalService_cfi.UnixSignalService
UnixSignalService
Definition: UnixSignalService_cfi.py:5
edm::service::UnixSignalService::fillDescriptions
static void fillDescriptions(ConfigurationDescriptions &descriptions)
Definition: UnixSignalService.cc:48
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
edm::ep_sigusr2
void ep_sigusr2(int, siginfo_t *, void *)
Definition: UnixSignalHandlers.cc:25
DEFINE_FWK_SERVICE_MAKER
#define DEFINE_FWK_SERVICE_MAKER(concrete, maker)
Definition: ServiceMaker.h:109
ParameterSetDescription.h
ServiceMaker.h
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
UnixSignalHandlers.h
edm::ParameterSetDescription::addUntracked
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:100
edm::ParameterSet
Definition: ParameterSet.h:36
edm::ConfigurationDescriptions::setComment
void setComment(std::string const &value)
Definition: ConfigurationDescriptions.cc:48
UnixSignalMaker
edm::serviceregistry::ParameterSetMaker< UnixSignalService > UnixSignalMaker
Definition: UnixSignalService.cc:63
edm::service::UnixSignalService::enableSigInt_
bool enableSigInt_
Definition: UnixSignalService.cc:30
edm::installCustomHandler
void installCustomHandler(int signum, CFUNC func)
Definition: UnixSignalHandlers.cc:93
ParameterSet.h
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27