mirror of
https://github.com/troglobit/finit.git
synced 2026-10-12 10:12:32 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a18c5f3441 | ||
|
|
03c47a4020 | ||
|
|
77b0df3d07 | ||
|
|
7e3465a022 | ||
|
|
04fd3f7a1b |
@@ -1,3 +1,12 @@
|
|||||||
|
1.7 (20121008)
|
||||||
|
- Show __FILE__ in _d() debug messages, useful for plugins with
|
||||||
|
similarily named callbacks. Also, only in debug mode anyway
|
||||||
|
- Make sure to cleanup recorded PID when a service is lost.
|
||||||
|
Required by service plugins for their callbacks to work.
|
||||||
|
- Bugfix: Do not free() static string in finit.conf parser
|
||||||
|
- Only clear screen when in verbose mode. Maybe this should
|
||||||
|
be removed altogether?
|
||||||
|
|
||||||
1.6 (20121006)
|
1.6 (20121006)
|
||||||
- Skip . and .. in plugin loader and display error on failed plugins
|
- Skip . and .. in plugin loader and display error on failed plugins
|
||||||
- Support for overriding /etc/finit.d with "runparts DIR" in finit.conf
|
- Support for overriding /etc/finit.d with "runparts DIR" in finit.conf
|
||||||
|
|||||||
@@ -29,7 +29,7 @@
|
|||||||
ROOTDIR = $(shell pwd)
|
ROOTDIR = $(shell pwd)
|
||||||
|
|
||||||
#VERSION ?= $(shell git tag -l | tail -1)
|
#VERSION ?= $(shell git tag -l | tail -1)
|
||||||
VERSION ?= 1.6
|
VERSION ?= 1.7
|
||||||
NAME = finit
|
NAME = finit
|
||||||
PKG = $(NAME)-$(VERSION)
|
PKG = $(NAME)-$(VERSION)
|
||||||
DEV = $(NAME)-dev
|
DEV = $(NAME)-dev
|
||||||
|
|||||||
@@ -64,9 +64,9 @@ void parse_finit_conf(char *file)
|
|||||||
char line[LINE_SIZE];
|
char line[LINE_SIZE];
|
||||||
char cmd[CMD_SIZE];
|
char cmd[CMD_SIZE];
|
||||||
|
|
||||||
/* Default username and hostname */
|
|
||||||
username = strdup(DEFUSER);
|
username = strdup(DEFUSER);
|
||||||
hostname = strdup(DEFHOST);
|
hostname = strdup(DEFHOST);
|
||||||
|
rcsd = strdup(FINIT_RCSD);
|
||||||
|
|
||||||
if ((fp = fopen(file, "r")) != NULL) {
|
if ((fp = fopen(file, "r")) != NULL) {
|
||||||
char *x;
|
char *x;
|
||||||
@@ -124,7 +124,7 @@ void parse_finit_conf(char *file)
|
|||||||
}
|
}
|
||||||
if (MATCH_CMD(line, "runparts ", x)) {
|
if (MATCH_CMD(line, "runparts ", x)) {
|
||||||
if (rcsd) free(rcsd);
|
if (rcsd) free(rcsd);
|
||||||
hostname = build_cmd(NULL, x, CMD_SIZE);
|
rcsd = build_cmd(NULL, x, CMD_SIZE);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (MATCH_CMD(line, "startx ", x)) {
|
if (MATCH_CMD(line, "startx ", x)) {
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ char *sdown = NULL;
|
|||||||
char *network = NULL;
|
char *network = NULL;
|
||||||
char *username = NULL;
|
char *username = NULL;
|
||||||
char *hostname = NULL;
|
char *hostname = NULL;
|
||||||
char *rcsd = FINIT_RCSD;
|
char *rcsd = NULL;
|
||||||
|
|
||||||
|
|
||||||
static void parse_kernel_cmdline(void)
|
static void parse_kernel_cmdline(void)
|
||||||
|
|||||||
@@ -653,7 +653,7 @@ void cls(void)
|
|||||||
{
|
{
|
||||||
static const char cls[] = "\e[2J\e[1;1H";
|
static const char cls[] = "\e[2J\e[1;1H";
|
||||||
|
|
||||||
if (!debug)
|
if (verbose)
|
||||||
fprintf (stderr, "%s", cls);
|
fprintf (stderr, "%s", cls);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -58,7 +58,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define echo(fmt, args...) do { if (verbose) { fprintf(stderr, fmt "\n", ##args); } } while (0)
|
#define echo(fmt, args...) do { if (verbose) { fprintf(stderr, fmt "\n", ##args); } } while (0)
|
||||||
#define _d(fmt, args...) do { if (debug) { fprintf(stderr, "finit:%s() - " fmt "\n", __func__, ##args); } } while (0)
|
#define _d(fmt, args...) do { if (debug) { fprintf(stderr, "finit:%s:%s() - " fmt "\n", __FILE__, __func__, ##args); } } while (0)
|
||||||
#define _e(fmt, args...) do { fprintf(stderr, "finit:%s:%s() - " fmt "\n", __FILE__, __func__, ##args); } while (0)
|
#define _e(fmt, args...) do { fprintf(stderr, "finit:%s:%s() - " fmt "\n", __FILE__, __func__, ##args); } while (0)
|
||||||
#define _pe(fmt, args...) do { fprintf(stderr, "finit:%s:%s() - " fmt ". Error %d: %s\n", __FILE__, __func__, ##args, errno, strerror(errno)); } while (0)
|
#define _pe(fmt, args...) do { fprintf(stderr, "finit:%s:%s() - " fmt ". Error %d: %s\n", __FILE__, __func__, ##args, errno, strerror(errno)); } while (0)
|
||||||
|
|
||||||
|
|||||||
@@ -248,6 +248,10 @@ void svc_monitor(void)
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
_d("Ouch, lost pid %d - %s(%d)", lost, name, svc->pid);
|
_d("Ouch, lost pid %d - %s(%d)", lost, name, svc->pid);
|
||||||
|
|
||||||
|
/* No longer running, update books. */
|
||||||
|
svc->pid = 0;
|
||||||
|
|
||||||
if (sig_stopped()) {
|
if (sig_stopped()) {
|
||||||
_e("Stopped, not respawning killed processes.");
|
_e("Stopped, not respawning killed processes.");
|
||||||
break;
|
break;
|
||||||
@@ -337,7 +341,7 @@ int svc_start(svc_t *svc)
|
|||||||
char arg[MAX_ARG_LEN];
|
char arg[MAX_ARG_LEN];
|
||||||
|
|
||||||
snprintf(arg, sizeof(arg), "%s ", args[i]);
|
snprintf(arg, sizeof(arg), "%s ", args[i]);
|
||||||
if ((sizeof(buf) - strlen(buf)) < strlen(arg))
|
if (strlen(arg) < (sizeof(buf) - strlen(buf)))
|
||||||
strcat(buf, arg);
|
strcat(buf, arg);
|
||||||
}
|
}
|
||||||
_e("%starting %s: %s", respawn ? "Res" : "S", svc->cmd, buf);
|
_e("%starting %s: %s", respawn ? "Res" : "S", svc->cmd, buf);
|
||||||
|
|||||||
Reference in New Issue
Block a user