File tree Expand file tree Collapse file tree 2 files changed +21
-4
lines changed
Expand file tree Collapse file tree 2 files changed +21
-4
lines changed Original file line number Diff line number Diff line change @@ -180,8 +180,15 @@ function _print_sm_studio_python() {
180180 echo -n " $SM_STUDIO_PYTHON "
181181}
182182
183+ function _is_ssh_ide_inside_studio() {
184+ [[ -f /opt/ml/metadata/resource-metadata.json ]]
185+ }
186+
187+
183188function _assert_is_ssh_ide_inside_studio() {
184- if [[ ! -f /opt/ml/metadata/resource-metadata.json ]]; then
189+ if _is_ssh_ide_inside_studio; then
190+ : # all good
191+ else
185192 echo " sm-ssh-ide: ERROR: must be running inside SageMaker Studio"
186193 exit 2
187194 fi
@@ -198,7 +205,8 @@ function _locale_gen() {
198205
199206function _start_syslogd() {
200207 if _is_centos; then
201- /usr/sbin/rsyslogd
208+ nohup /usr/sbin/rsyslogd &
209+ nohup /usr/lib/systemd/systemd-journald &
202210 else
203211 service rsyslog start || (echo " ERROR: Failed to start syslogd service" )
204212 fi
Original file line number Diff line number Diff line change @@ -43,8 +43,17 @@ if [[ "$1" == "configure" ]]; then
4343 fi
4444
4545 # Sending all system logs to CloudWatch (helps to troubleshoot sshd issues)
46- find /etc/rsyslog.conf /etc/rsyslog.d/ -type f \
47- -exec sed -i -e ' s~/var/log/~/var/log/apps/app_container.log__~' {} \;
46+ if _is_ssh_ide_inside_studio; then
47+ find /etc/rsyslog.conf /etc/rsyslog.d/ -type f \
48+ -exec sed -i -e ' s~/var/log/~/var/log/apps/app_container.log__~' {} \;
49+ else
50+ find /etc/rsyslog.conf /etc/rsyslog.d/ -type f \
51+ -exec sed -i -e ' s~/var/log/.*~/proc/1/fd/1~' {} \;
52+ # shellcheck disable=SC2016
53+ sed -i -e ' s~^$PrivDropToUser~#$PrivDropToUser~' /etc/rsyslog.conf
54+ # shellcheck disable=SC2016
55+ sed -i -e ' s~^$PrivDropToGroup~#$PrivDropToGroup~' /etc/rsyslog.conf
56+ fi
4857
4958 sed -i -e ' s~^ClientAliveInterval~#ClientAliveInterval~' /etc/ssh/sshd_config
5059 echo " ClientAliveInterval 15" >> /etc/ssh/sshd_config
You can’t perform that action at this time.
0 commit comments