Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Here is the output of ls -l from /Library/FileMaker\ Server/Data/Scripts/

-rwxrwxrwx@ 1 fmserver fmsadmin 73 Dec 5 15:17 touch.sh

This is the shell script:


!#/bin/bash

touch /Library/FileMaker\ Server/Data/Documents/touchtest.txt





This is the failure in the FileMaker server logs:





2011-12-05 15:26:59.389 -0500 Information 146 filemaker.hostname.com Schedule "touch" run now by "accountname [123.456.7.8]".

2011-12-05 15:26:59.395 -0500 Error 642 filemaker.hostname.com Schedule "touch" aborted; unexpected error. (-1)

This bash script is being called from a scheduled system script from FMS. Nothing else is attached to it like in a script sequence. I am using the default user ( FMServer ).

What am I missing that is causing this very basic script not to run?

The shebang line start with #!

#!/bin/bash

touch /Library/FileMaker\ Server/Data/Documents/touchtest.txt

With that wrong the server doesn't know what to launch.

  • Author

I actually had that right but in a last ditch effort, I changed it to !# incase for some reason I had that wrong. I copied and pasted that line to the forum. oops. The error remain even with #! Any other thoughts? The script works fine from terminal. It really does not get any simpler than touch to test things out.

Two ideas:

test from Terminal as user fmserver ( su fmserver ). Does that work?

What is the meaning of the @ in the ls -l output?

  • Author

I have no idea what the password of fmserver is.

  • Author

The "@" sign -- which is not documented in the manual page for ls(1) -- indicates that the file has extended attributes. You can use the command 'xattr -l <filename>' to show them.

On touch.sh that command returns:


com.apple.FinderInfo:

00000000  54 45 58 54 21 52 63 68 00 00 00 00 00 00 00 00  |TEXT!Rch........|

00000010  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  |................|

00000020

com.apple.TextEncoding: UTF-8;134217984

So you're editing with BBEdit ;-)

If you don't know what the root user is, stop here

To act as fmuser without knowing the pw:

- in a Terminal:

# going to root

su

# after entering pw

sudo -u fmserver /Library/FileMaker Server/Data/Scripts/touch.sh

That should execute the script as fmserver.

  • Author

The fmserver user was able to execute and create the touch file.

These are the steps I did in terminal. Notice I confirmed I was fmserver.


machine:~ user$ su

Password:

sh-3.2# su fmserver

bash-3.2$ whoami

fmserver

bash-3.2$ /Library/FileMaker Server/Data/Scripts/touch.sh

bash-3.2$

When in doubt, RTFM.

The docs say you can set user & group for the script to run in. Perhaps using fmserver:fmsadmin is the error here.

I'm out of ideas and don't have a FMS to poke around here.

The default fmserver account probably does not have privileges to do what the script asks. If creating a file, that file must be within the FMS security bubble. if it's outside, then it likely will not work. BTW, use something like the ChangeMOD utility to check the read/write privileges of the script file itself.

Steven

  • Author

i was able to execute it under the fmserver user as revealed by my whoami I did just prior to executing the touchtest.sh as seen above in the thread so why would it be different if run under a scheduled script?

The file is being created in the "Bubble" at /Library/FileMaker Server/Data/Documents/

I did use chmod fmserver:fmsadmin on touchtest.sh The ls -l I placed higher in this thread shows the permissions are correct including that the file is executable. Again, I was able to execute it as fmserver when I used su.

What else might I be missing?

  • Author

When in doubt, RTFM.

I hear ya, but that thing lacks some serious detail. Amazing the details it lacks. It would also be nice if there was some more effective error communication to the logs!

  • Author

RAID Utility says that the status of each drive is "Good" but that SMART status is Unsupported. I had planned on doing a drive replacement soon. Tracking says the new drives are arriving today.

  • Author

Fresh OS and fresh FMS 11 and all weird behavior is gone.

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.