I noticed there is no guide on how to use H@H on BSD systems so I thought I would make quick guide on getting it running as a service.
Platform: FreeBSD 11.1 (in a Jail. Make sure you allow raw sockets!)
Packages: ca_root_nss, openjdk8
Other files: Newest package from
https://e-hentai.org/hentaiathome.php1)unpack the zip to wherever you want (e.g. /usr/bin/local/share/hath). I used /config which was mounted via fstab.
2)make a user to run the program. Do NOT run it as root even if its in a jail and you also don't need to have a user with a home or login shell. I used the following:
hath:*:6969:6969::0:0:hath:/nonexistent:/usr/bin/nologin
3)run the program once to get it setup: java -Djava.net.preferIPv4Stack=true -jar /path/to/h@h/h@h.jar
4)once it is setup you can CTRL+C
5)make an rc.d script (e.g., /usr/local/etc/rc.d/hath)
6)use this but make sure to change things based on where you put and named H@H:
CODE
#!/bin/sh
# $FreeBSD$
#
# PROVIDE: hath
# REQUIRE: LOGIN SERVERS DAEMON resolv
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
# to enable this service:
#
# hath_enable: Set to YES to enable hath
# Default: NO
# hath_user: The user account used to run the hath daemon.
# This is optional, however do not specifically set this to an
# empty string as this will cause the daemon to run as root.
# Default: hath
# hath_group: The group account used to run the hath daemon.
# This is optional, however do not specifically set this to an
# empty string as this will cause the daemon to run with group wheel.
# Default: hath
# hath_data_dir: Directory where hath configuration
# data is stored.
# Default: /config
. /etc/rc.subr
name="hath"
rcvar=${name}_enable
hath_chdir="/config"
load_rc_config $name
: ${hath_enable:="NO"}
: ${hath_user:="hath"}
: ${hath_group:="hath"}
: ${hath_data_dir:="/config"}
pidfile_child="${hath_data_dir}/${name}.pid"
pidfile="${hath_data_dir}/${name}_daemon.pid"
command="/usr/sbin/daemon"
start_precmd="${name}_prestart"
#procname="java" #not all ports correctly parse this in daemon form so I have removed it
hath_prestart() {
rc_flags="-r -P ${pidfile} -p ${pidfile_child} /usr/local/bin/java -Djava.net.preferIPv4Stack=true -jar /config/hath.jar >> /dev/null 2>&1 ${rc_flags}"
}
run_rc_command "$1"
7)don't forget to fix permissions of files in H@H path (owner:group should be H@H user) and the new script (u+x should be fine). Also make sure rc.conf contains ATLEAST hath_enable="YES"
8)start the service: service hath start
9)enjoy!
EDIT: updated packages for 1.6.0 and 1.6.1 openjdk8 is REQUIRED
This post has been edited by myaccount: Sep 5 2020, 06:31