Fixed dest folder memory allocation. Added service file
This commit is contained in:
parent
0102605c07
commit
9c239c6bb2
16
freemind-mindgen.service
Normal file
16
freemind-mindgen.service
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Calendar Auto Generator
|
||||||
|
After=network.target multi-user.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Restart=always
|
||||||
|
RestartSec=1
|
||||||
|
User=root
|
||||||
|
WorkingDirectory=/root/freemind-mindgen/
|
||||||
|
ExecStart=/root/freemind-mindgen/watcher /root/calendar/ /var/www/links/calendar/
|
||||||
|
StandardOutput=syslog
|
||||||
|
StandardError=syslog
|
||||||
|
SyslogIdentifier=CalendarGen
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
@ -29,7 +29,7 @@ int is_dir(const char* _filepath);
|
|||||||
*
|
*
|
||||||
* Returns -1 on error;
|
* Returns -1 on error;
|
||||||
*/
|
*/
|
||||||
int execute_mindgen();
|
int execute_mindgen(const char* _dest_dir, const char* _filename, const char* _source_dir);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Executes the deletion command
|
* Executes the deletion command
|
||||||
@ -184,7 +184,7 @@ int execute_mindgen(const char* dest_dir, const char* filename, const char* sour
|
|||||||
int pid;
|
int pid;
|
||||||
int child_status;
|
int child_status;
|
||||||
char source_fullname[strlen(source_dir) + strlen(filename) + 2];
|
char source_fullname[strlen(source_dir) + strlen(filename) + 2];
|
||||||
char dest_fullname[strlen(source_dir) + strlen(filename) + 7];
|
char dest_fullname[strlen(dest_dir) + strlen(filename) + 7];
|
||||||
char* arglist[4];
|
char* arglist[4];
|
||||||
|
|
||||||
pid = fork();
|
pid = fork();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user