Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
S
scom
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
SulinOS
scom
Commits
4e1ba939
Kaydet (Commit)
4e1ba939
authored
Eyl 14, 2019
tarafından
Suleyman Poyraz
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Daemon bazlı hata var. Ancak --daemon parametresi eklendi.
üst
a294df87
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
40 additions
and
3 deletions
+40
-3
config.h
scom/include/config.h
+1
-0
daemon.h
scom/include/daemon.h
+27
-1
config.c
scom/src/config.c
+4
-0
loop.c
scom/src/loop.c
+3
-0
main.c
scom/src/main.c
+5
-2
No files found.
scom/include/config.h
Dosyayı görüntüle @
4e1ba939
...
...
@@ -76,6 +76,7 @@ extern int config_debug;
extern
int
config_print
;
extern
int
config_runlevel
;
extern
int
config_ignore_missing
;
extern
int
config_daemon
;
extern
char
*
config_dir_models
;
extern
char
*
config_dir_modules
;
...
...
scom/
src/daemon.c
→
scom/
include/daemon.h
Dosyayı görüntüle @
4e1ba939
/*
*
* Copyright (c) 2019, Ali Rıza Keskin
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use, copy,
* modify, merge, publish, distribute, sublicense, and/or sell copies
* of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
*/
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
...
...
@@ -46,7 +72,7 @@ static void skeleton_daemon()
/* Change the working directory to the root directory */
/* or another appropriated directory */
chdir
(
"/"
);
chdir
(
"/"
);
//FIXME: Try it for problems
/* Close all open file descriptors */
int
x
;
...
...
scom/src/config.c
Dosyayı görüntüle @
4e1ba939
...
...
@@ -86,6 +86,9 @@ int config_print = 0;
//! Runlevel (1 after logging enabled)
int
config_runlevel
=
0
;
//! Daemon mode (1 after daemon mode enabled)
int
config_daemon
=
0
;
//! Ignore missing functions
int
config_ignore_missing
=
0
;
...
...
@@ -97,6 +100,7 @@ static struct option longopts[] = {
{
"ignore-missing"
,
0
,
NULL
,
'i'
},
{
"logdir"
,
required_argument
,
NULL
,
'l'
},
{
"print"
,
0
,
NULL
,
'p'
},
{
"daemon"
,
0
,
NULL
,
'q'
},
{
"socket"
,
required_argument
,
NULL
,
's'
},
{
"timeout"
,
required_argument
,
NULL
,
't'
},
{
"help"
,
0
,
NULL
,
'h'
},
...
...
scom/src/loop.c
Dosyayı görüntüle @
4e1ba939
...
...
@@ -188,6 +188,7 @@ handle_core_message(DBusMessage *bus_msg, const char *path, const char *iface, c
}
bus_reply_object
(
bus_msg
,
py_list
,
"as"
);
}
// TODO: add some new features
}
static
DBusHandlerResult
...
...
@@ -215,9 +216,11 @@ filter_func(DBusConnection *conn, DBusMessage *bus_msg, void *data)
log_debug
(
"Got message '%s.%s' from '%s'
\n
"
,
iface
,
method
,
sender
);
if
(
strcmp
(
config_interface
,
iface
)
==
0
&&
strcmp
(
path
,
"/"
)
==
0
)
{
// "setLocale" and "cancel" methods are handled in main process
// TODO: Öncekine giden yol
if
(
strcmp
(
method
,
"setLocale"
)
==
0
||
strcmp
(
method
,
"cancel"
)
==
0
||
strcmp
(
method
,
"listRunning"
)
==
0
)
{
handle_core_message
(
bus_msg
,
path
,
iface
,
method
,
sender
,
py_args
);
}
else
{
// Else, handle in child process
proc_fork
(
handle_message
,
bus_msg
);
...
...
scom/src/main.c
Dosyayı görüntüle @
4e1ba939
...
...
@@ -30,7 +30,7 @@
#include "process.h"
#include "script.h"
#include "utils.h"
#include "daemon.
c
"
#include "daemon.
h
"
#include <stdio.h>
#include <stdlib.h>
...
...
@@ -82,7 +82,10 @@ main(int argc, char *argv[])
proc_init
();
// Daemon start
skeleton_daemon
();
if
(
config_daemon
==
1
)
{
skeleton_daemon
();
}
// Enter main loop
loop_exec
();
...
...
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