Skip to content

Commit

Permalink
Create classd service file
Browse files Browse the repository at this point in the history
  • Loading branch information
mikegee88 authored and trilok-venkata committed Dec 13, 2023
1 parent f4f9ed7 commit 6541f0b
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 3 deletions.
2 changes: 2 additions & 0 deletions classd/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ define Package/classd/install
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/classd $(1)/usr/bin/
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libnavl.so* $(1)/usr/lib/
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/share/untangle-classd/protolist.csv $(1)/usr/share/untangle-classd/
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) files/classd.init $(1)/etc/init.d/classd
endef

$(eval $(call BuildPackage,classd))
31 changes: 31 additions & 0 deletions classd/files/classd.init
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/sh /etc/rc.common
# Copyright (C) 2006-2011 OpenWrt.org

START=92
STOP=02

USE_PROCD=1

start_service() {
procd_open_instance classd

# procd_set_param env GODEBUG=schedtrace=30000
# procd_set_param env GODEBUG=schedtrace=30000,scheddetail=1

# if not hybrid mode, start the packetd
if [ -e /etc/config/hybrid ]
then
# procd command to run
procd_set_param command /usr/bin/classd -mfw -w65536 -d
fi

# restart indefinitely if crashed, 5 seconds between attempts
procd_set_param respawn 3600 5 0

# stdout to system log
procd_set_param stdout 1
# stderr to system log
procd_set_param stderr 1

procd_close_instance
}
3 changes: 0 additions & 3 deletions packetd/files/packetd.init
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@ start_service() {

# restart indefinitely if crashed, 5 seconds between attempts
procd_set_param respawn 3600 5 0
else
# Hybrid mode, start classd daemon
procd_set_param command /usr/bin/classd -mfw -w65536 -d
fi

# stdout to system log
Expand Down

0 comments on commit 6541f0b

Please sign in to comment.