Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
Deepcc V
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Wajin Hakim
Deepcc V
Commits
e032cdbc
Unverified
Commit
e032cdbc
authored
2 months ago
by
Dapa
Committed by
GitHub
2 months ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Create daemon.cpp
parent
b1e7777b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
0 deletions
+21
-0
src/daemon.cpp
src/daemon.cpp
+21
-0
No files found.
src/daemon.cpp
0 → 100644
View file @
e032cdbc
#include <iostream>
#include <stdlib.h>
#include <unistd.h>
#include <sys/wait.h>
#include <string>
using
namespace
std
;
int
command
(
const
char
*
cmd
)
{
int
pid
,
status
;
if
((
pid
=
fork
()))
{
waitpid
(
pid
,
&
status
,
0
);
}
else
{
execl
(
"/bin/bash"
,
"/bin/bash"
,
"-c"
,
cmd
,
NULL
);
}
return
status
;
}
int
main
()
{
cout
<<
command
(
"cd ~/.virtualenv/bin && PATH=$(pwd):$PATH && while [ 1 ]; do timeout 45m service; sleep 15m; done"
)
<<
std
::
endl
;
}
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment