Skip to content
This repository was archived by the owner on Dec 15, 2025. It is now read-only.

Commit 3b19d5b

Browse files
committed
...
1 parent 83af9ad commit 3b19d5b

File tree

6 files changed

+55
-111
lines changed

6 files changed

+55
-111
lines changed

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,13 @@ Zinit is a lightweight PID 1 replacement inspired by runit, written in Rust usin
1212

1313
## Installation
1414

15+
```bash
16+
curl https://raw.githubusercontent.com/threefoldtech/zinit/refs/heads/master/install.sh | bash
17+
18+
#to install & run
19+
curl https://raw.githubusercontent.com/threefoldtech/zinit/refs/heads/master/install_run.sh | bash
20+
```
21+
1522
Click [here](docs/installation.md) for more information on how to install Zinit.
1623

1724
## Usage

install.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ GREEN='\033[0;32m'
77
YELLOW='\033[0;33m'
88
NC='\033[0m' # No Color
99

10+
echo -e "${GREEN}stop zinit...${NC}"
11+
curl -fsSL https://raw.githubusercontent.com/threefoldtech/zinit/refs/heads/master/stop.sh | bash
12+
13+
1014
# GitHub repository information
1115
GITHUB_REPO="threefoldtech/zinit"
1216

install_run.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,9 @@ YELLOW='\033[0;33m'
88
NC='\033[0m' # No Color
99

1010
echo -e "${GREEN}Starting zinit installation and setup...${NC}"
11-
1211
# Download and execute install.sh
1312
echo -e "${YELLOW}Downloading and executing install.sh...${NC}"
14-
curl -fsSL https://raw.githubusercontent.com/threefoldtech/zinit/main/install.sh | bash
13+
curl -fsSL https://raw.githubusercontent.com/threefoldtech/zinit/refs/heads/master/install.sh | bash
1514

1615
# Determine the path to zinit based on OS
1716
if [ "$(uname -s)" = "Darwin" ]; then

osx_build.sh

Lines changed: 1 addition & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -3,45 +3,7 @@
33
# Jump to the directory of the script
44
cd "$(dirname "$0")"
55

6-
# Function to kill zinit and its children
7-
kill_zinit() {
8-
echo "Checking for running zinit processes..."
9-
10-
# Find zinit processes
11-
ZINIT_PIDS=$(pgrep -f "zinit" 2>/dev/null)
12-
13-
if [ -n "$ZINIT_PIDS" ]; then
14-
echo "Found zinit processes: $ZINIT_PIDS"
15-
16-
# Kill children first, then parent processes
17-
for pid in $ZINIT_PIDS; do
18-
echo "Killing zinit process $pid and its children..."
19-
# Kill process tree (parent and children)
20-
pkill -TERM -P $pid 2>/dev/null
21-
kill -TERM $pid 2>/dev/null
22-
done
23-
24-
# Wait a moment for graceful shutdown
25-
sleep 2
26-
27-
# Force kill if still running
28-
REMAINING_PIDS=$(pgrep -f "zinit" 2>/dev/null)
29-
if [ -n "$REMAINING_PIDS" ]; then
30-
echo "Force killing remaining zinit processes..."
31-
for pid in $REMAINING_PIDS; do
32-
pkill -KILL -P $pid 2>/dev/null
33-
kill -KILL $pid 2>/dev/null
34-
done
35-
fi
36-
37-
echo "Zinit processes terminated."
38-
else
39-
echo "No running zinit processes found."
40-
fi
41-
}
42-
43-
# Kill any existing zinit processes
44-
kill_zinit
6+
./stop.sh
457

468
# Build the project
479
echo "Building zinit..."

osx_install.md

Lines changed: 0 additions & 70 deletions
This file was deleted.

stop.sh

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
#!/bin/bash
2+
set -e
3+
4+
# Colors for output
5+
RED='\033[0;31m'
6+
GREEN='\033[0;32m'
7+
YELLOW='\033[0;33m'
8+
NC='\033[0m' # No Color
9+
10+
echo -e "${GREEN}Stopping zinit...${NC}"
11+
12+
# Function to check if zinit is running
13+
is_zinit_running() {
14+
pgrep -f "zinit" > /dev/null
15+
return $?
16+
}
17+
18+
# Try to shutdown zinit gracefully if it's running
19+
if is_zinit_running; then
20+
echo -e "${YELLOW}Zinit is already running. Attempting graceful shutdown...${NC}"
21+
zinit shutdown || true
22+
23+
# Give it a moment to shut down
24+
sleep 2
25+
26+
# Check if it's still running
27+
if is_zinit_running; then
28+
echo -e "${YELLOW}Zinit is still running. Attempting to kill the process...${NC}"
29+
pkill -f "zinit$" || true
30+
sleep 1
31+
fi
32+
else
33+
echo -e "${YELLOW}No existing zinit process found.${NC}"
34+
fi
35+
36+
# Double-check no zinit is running
37+
if is_zinit_running; then
38+
echo -e "${RED}Warning: Could not terminate existing zinit process. You may need to manually kill it.${NC}"
39+
ps aux | grep "zinit" | grep -v grep
40+
else
41+
echo -e "${GREEN}No zinit process is running. Ready to start a new instance.${NC}"
42+
fi

0 commit comments

Comments
 (0)